Cabinet Noir>Learn / Pigpen cipher

Not sure which cipher? Identify it
A symbol substitution: every letter becomes a fragment of a grid — the famous Freemason's cipher.
Typesubstitution cipher
Breaking ittrivial to break
Era18th century (variants since antiquity)
NamePopularly the Freemasons, who used it for records and rites; earlier variants are older still.
Modesencrypt · decrypt

Learn

Pigpen cipher

How the Pigpen cipher works

The idea in one sentence

Pigpen is a Substitution where the replacement symbols are not letters at all: every letter becomes a small drawing — a fragment of a grid, with or without a dot — the famous "Freemason's cipher".

The recipe

  1. Draw three shapes: two tic-tac-toe grids (#) and two diagonal crosses (X).

  2. Fill the first grid with A–I, the second with J–R, and put S–V and W–Z on the arms of the two crosses.

  3. Dots are the second half of the secret: the second grid and the second cross carry a dot in each pen. Without the dot the same shape means A, with the dot it means J.

  4. To encrypt, replace each letter by the drawing of the pen it lives in. To decrypt, read each glyph and write down the letter whose pen has that shape.

A worked example

Step 1 of 3
Plaintext letter
Glyph
S

Each row pairs the letter with the drawing it becomes. S, the first letter, lives on the plain cross: its glyph is a V-shape — the two strokes of the cross that bound the top arm. O, the fifteenth letter, lives in the dotted grid: the same kind of corner shape as A, but with a dot inside.

Why the shapes look like this

Nothing is memorised: every glyph is derived. The key below is the whole secret — two grids, two crosses — and every glyph is simply the walls of one pen of these figures, cut out and carried alone:

ABCDEFGHIJKLMNOPQRSTUVWXYZ

The dot is the only added mark, and it says one thing: second set — the dotted grid holds J–R, the dotted cross holds W–Z. Take H: it lives in the bottom-middle pen of the first grid, so its glyph is that pen's walls — a ceiling and two side walls, open at the bottom.

ABCDEFGHIJKLMNOPQRSTUVWXYZH

A pen in the middle is a full box, a pen in a corner is an L-shape, a pen on an edge is open on one side. This is why the cipher is so easy to learn by hand — and, as the breaking-it page explains, why it is so easy to break.

Try it in the tool

Step-by-step guides

Encrypt your first message

  1. Type your message into the message input.

  2. Pick a symbol set with the variant selector — the classic masonic grids are the default. The variants all encode the same cipher; they only differ in how the pens are arranged and dotted.

  3. Watch the glyph strip fill up under the selector: every letter you type becomes a drawing. The the output field field shows the copy-as-text legend — the glyph list is graphics, so the legend is what a clipboard can carry.

Decrypt a message you received

  1. Press the swap button the swap button to switch to decrypt mode.

  2. The glyph keyboard appears instead of the strip: click the symbols of the message in order — the keys show only the drawings, no letters, exactly like a real ciphertext. Each click appends its letter to the input.

  3. You can also type into the message input directly if a keyboard is easier for you; both paths feed the same message.

  4. Read the decoded text in the output field.

Read pigpen around you

Once you know the three shapes, pigpen starts appearing in the wild:

  1. Gravestones and memorial plaques — Freemasons used it in engravings, and a famous cipher on a New York tombstone reads "Remember death".

  2. Puzzle hunts, escape rooms and children's books — pigpen is the most borrowed "secret writing" in print, so most puzzle authors assume you can read it.

  3. Fiction and games — from pirate-treasure stories to video games, the grid fragments signal "secret message" to any reader.

Breaking the Pigpen cipher

Pigpen looks unbreakable to a beginner — alien symbols, no letters to count — and is in fact the fastest cipher on this site to break after Atbash. This page shows why the strangeness is only skin deep.

The flaw: a substitution in costume

Strip the drawings away and pigpen is a plain monoalphabetic Substitution: exactly one fixed mapping from letters to symbols, no key, no choices beyond the variant. Everything that breaks a simple substitution applies unchanged — there are only 26 symbols to identify, and the plaintext is ordinary language.

Attack — treat it as a reading exercise

  1. Recognise the cipher first. Grid fragments and dotted shapes are instantly recognisable: the interceptor usually does not need to break pigpen, only to decipher it — the key is public knowledge, like the alphabet itself.

  2. Identify the variant. The symbol set is usually guessable: masonic grids first, then the dotted-pen or cross variants. Trying the handful of published variants costs minutes.

  3. Fall back on Frequency analysis. If the variant is non-standard, count the symbols: the most frequent glyph is almost surely E, T or A, doubled symbols are L, T or E, and the shape grammar (walls, dots, arms) constrains the guesses further. A hand-sized text falls to the same statistics as any monoalphabetic cipher.

Why there is no cracker here

The guided crackers on this site earn their place by searching a key space: shifts, multipliers, disc rotations, column permutations. Pigpen has nothing to search — once the variant is identified, the mapping is complete. A future cracker would only automate variant recognition; if a message resists that, it is not really pigpen.

What pigpen teaches

Pigpen is the purest lesson in the difference between secrecy of the method and secrecy of the key: a system whose security rests on the assumption that the adversary has never seen a Freemason's gravestone is not a system, it is a hope. That is exactly the assumption every serious cipher design refuses to make.

Glossary

Plaintext — The original readable message before encryption.
Ciphertext — The scrambled message produced by encryption.
Substitution — Replacing each letter with another one.
Frequency analysis — Studying how often letters appear; comparing the counts with the language reveals the plaintext.