The grid-and-dot idea is old. Medieval sources describe ciphers built from the parts of a cross, and in 1531 Cornelius Agrippa described an early form of what later authors called the Rosicrucian cipher — a single grid of nine "pens" whose dot positions carry the alphabet. He attributed it to Jewish Kabbalistic tradition, the "Kabbalah of the Nine Chambers", where it served religious symbolism more than secrecy.
The cipher's fame comes from Freemasonry. Lodges used pigpen from the early 18th century to keep records of history and rites private and for correspondence between lodge leaders — so persistently that the system is now simply called the Freemason's cipher. It is carved where you would expect it: Freemason tombstones carry pigpen engravings, and one of the earliest stones in New York's Trinity Church cemetery deciphers to "Remember death" — a masonic memento mori.
On 7 July 1730 the French pirate Olivier Levasseur reportedly threw a scrap of pigpen ciphertext into the crowd at his execution — allegedly the whereabouts of his never-found treasure. The message has never been decisively read, and the exact grid arrangement died with him: an early lesson that a non-standard variant forces real cryptanalysis. During the American Civil War, Union prisoners in Confederate prisons used pigpen to smuggle messages past their captors, and George Washington's army documentation shows a randomized-alphabet version of the system.
Websites happily attribute the cross-armed variant to the medieval Knights Templar. The scholarly source for the "Templar cipher" itself says otherwise: the alphabet-splitting, cross-armed system is the work of Neo-Templar Freemasons of the 18th century, not the religious order of the 12th–14th centuries. The medieval order left no such cipher; the legend is modern branding on an old idea.
The cipher survived by becoming a game. It appears in children's books on secret writing, puzzle hunts, escape rooms, treasure-fiction from Verne onward, and even in a settler's 1852 Australian diary examined by historians two centuries later. Pigpen is not used to protect anything — it is used to signal secrecy, which may be the most durable job a cipher can have.