Despite its many (many) variations, this is the actual quote:
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety.
According to Wittes, the words appear in a letter widely presumed to be written by Franklin in 1755 on behalf of the Pennsylvania Assembly to the colonial governor. “The letter was a salvo in a power struggle between the governor and the assembly over funding for security on the frontier, one in which the assembly wished to tax the lands of the Penn family,” he explains.
The letter wasn’t about liberty but about taxes and the ability to “raise money for defense against French and Indian attacks. The governor kept vetoing the assembly’s efforts at the behest of the family, which had appointed him.”