The Pigpen Cipher in Latex

Recently my son and his friends have been enjoying sending secret messages back-and-forth using the pigpen cipher (also called the masonic cipher or Freemason’s cipher). It produces codes that look like:

The pigpen cipher is a simple substitution cipher—there is a 1-1 correspondence between these special symbols and letters of the alphabet. The correspondence is illustrated in the chart below. Each letter is replaced by the boundaries around the letter and a dot if there is one. So, for example,

I, being a lover of Latex, wondered if it was possible to create pigpen ciphers in Latex. It is! The cipher text text above was created using Oliver Corff’s Pigpen Cipher package. After downloading the package and including it in the Latex file you must simply type

{\pigpenfont MATH IS FUN}

to obtain

(Pigpen cipher key (picture) from Wikipedia)


  1. Jim Goltz says:

    I don’t know if you’re interested, I recently used Corff’s font to create my own font, the Rose Croix Cipher font, after failing to find anything similar online. Examples of the Rose Croix Cipher can be seen at, at the top and bottom of the page. (The Rose Croix is the 18th degree of the Scottish Rite of Freemasonry.)

    1. Nice work. Thanks for the link.

Comments are closed.