This statement was used as a motto on the title page of An Historical Review of the Constitution and Government of Pennsylvania (1759) which was attributed to Franklin in the edition of 1812, but in a letter of September 27, 1760 to David Hume, he states that he published this book and denies that he wrote it, other than a few remarks that were credited to the Pennsylvania Assembly, in which he served.
The phrase itself was first used in a letter from that Assembly dated November 11, 1755 to the Governor of Pennsylvania. An article on the origins of this statement here includes a scan that indicates the original typography of the 1759 document, which uses an archaic form of “s”:
“Thoſe who would give up Essential Liberty to purchaſe a little Temporary Safety, deserve neither Liberty nor Safety.”
Researchers now believe that a fellow diplomat by the name of Richard Jackson is the primary author of the book. With the information thus far available the issue of authorship of the statement is not yet definitely resolved, but the evidence indicates it was very likely Franklin, who in the Poor Richard’s Almanack of 1738 is known to have written a similar proverb: “Sell not virtue to purchase wealth, nor Liberty to purchase power.”