Substitution cipher
A substitution cipher swaps every letter for another using a scrambled alphabet. There are about 400 million million million million possible alphabets, far too many to try. Yet a ninth-century scholar showed how to break it with nothing more than counting.
A little history
Substitution ciphers were the standard way to keep secrets for well over a thousand years. Around the 800s, the Arab scholar al-Kindi wrote the first known description of frequency analysis: in any language, some letters are far more common than others, and the same is true of their substitutes. In 1586, Mary, Queen of Scots trusted a substitution cipher to plot against Elizabeth I. Elizabeth's codebreaker Thomas Phelippes broke it by counting letters, and the decrypted letters led to Mary's execution.
How it works
Write out any rearrangement of the alphabet. That's the key. Each message letter is swapped for the letter in the same position of the key alphabet.
ABCDEFGHIJKLMNOPQRSTUVWXYZQWERTYUIOPASDFGHJKLZXCVBNMSPIESLHOTLThe number of possible keys is 26 × 25 × 24 × … × 1, written 26! (26 factorial): about 4 × 10²⁶. Even checking a billion keys a second would take billions of years.
How to crack it
Don't search keys; read patterns. In English, E, T, A and O are the most common letters, TH and HE the most common pairs, and THE the most common word. Count the cipher letters, match the most common ones, and look for words with telltale shapes: a three-letter word that appears often is probably THE, and a word like XYZZYX with repeated letters in those places can only be a few words. Each letter you fix makes the next guess easier.
Substitution in Cyrune
With only five letters, there isn't enough text to count, so your coloured guesses do the work. Repeated lamps still mean repeated letters, which narrows down the word's shape. Tap a window and type a letter to build the key one letter at a time.
Related ciphers
- Keyword cipher ★★★★☆
- Pigpen cipher ★★★☆☆
- Affine cipher ★★★★☆