But first two real Madison quotes that are often paired with it.
First, from Madison's "Political Observations" (1795):
Of all the enemies to public liberty war is, perhaps, the most to be dreaded, because it comprises and develops the germ of every other. War is the parent of armies; from these proceed debts and taxes; and armies, and debts, and taxes are the known instruments for bringing the many under the domination of the few. In war, too, the discretionary power of the Executive is extended; its influence in dealing out offices, honors, and emoluments is multiplied; and all the means of seducing the minds, are added to those of subduing the force, of the people. The same malignant aspect in republicanism may be traced in the inequality of fortunes, and the opportunities of fraud, growing out of a state of war, and in the degeneracy of manners and of morals engendered by both. No nation could preserve its freedom in the midst of continual warfare.I don't have a copy of Madison's collected papers handy, but this quote is well sourced: Scott Horton gives a full citation here, for example. This looks like a complete online edition of the pamphlet, but as always, caveat surftor.
Second, from a May 13, 1798 letter to Thomas Jefferson:
Perhaps it is a universal truth that the loss of liberty at home is to be charged to provisions agst. [against] danger real or pretended from abroad.The letter is reprinted in this 1865 edition of Madison's letters, online thanks to the awesomeness of Google Books; or, in a perhaps more accessible format, you can read the letter online here, from this site which offers a lot of Madison's papers online (although not, alas, the 1795 "Political Observations").
Finally, the (apparently) spurious quotation:
If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy.-- This is quoted all over the place, and almost always attributed to Madison (although at least once to (!)), but the citations are never specific. (I hate it when quote sites don't give real citations!) A bunch of sites specify that he said it while in Congress -- a bit of pseudo-specificity that makes it sound genuine but doesn't actually help in tracking it down. At least one article I've seen specifically says it's a made-up quote -- suggesting, persuasively, that it's a corruption of the second quote given above. (Frankly, any time a quote is widely quoted but never given a specific citation, skepticism is called for.) The Madison page I cited before gives the quote.. but only without a proper citation on their "Madison quotes" page. (Doesn't inspire much confidence in the web site, frankly.)
So: unless anyone has a real citation for that last quote, I have to say that it's most probably made up.