Cryptography Advanced

Substitution Cipher & Frequency Analysis

Any one-to-one letter substitution has 26! ≈ 4 × 1026 keys — far too many to search — and still falls to letter counting. Encrypt with a random key, then break it: compare frequencies, assign guesses, and watch English appear.

Live frequency chart
Click-to-assign mapping
Digrams and common words
Live
Ciphertext
Ciphertext letter frequencies vs English
this text English
Letters0
Index of coincidence—
Most common—
Letters assigned0 / 26
Your Decryption
Plaintext so far — assigned letters in green, unknown in grey
Mapping — type the plaintext letter under each ciphertext letter
A monoalphabetic substitution keeps every statistic of the plaintext except the letter names. That is why the bar chart is the whole attack: find the shape, then match it.
Patterns That Give It Away
Most common digrams in your text

English favours TH, HE, IN, ER, AN, RE, ON, AT.

PairCount
Short words

One-letter words are A or I. Three-letter words are very often THE or AND.

WordLengthCount
Doubled letters

In English the common doubles are LL, EE, SS, OO, TT, FF, RR, NN, PP.

A Huge Key Space That Does Not Help
26! = 403,291,461,126,605,635,584,000,000 keys

A general substitution cipher picks any one-to-one map of the alphabet onto itself. There are 26! of them — about 4 × 1026, which no computer will ever enumerate.

And yet a newspaper cryptogram falls in a few minutes with pencil and paper. The reason is that the key space is irrelevant when the plaintext statistics survive.

Substitution renames letters; it does not change how often they occur, which pairs sit together, or how long the words are. Every one of those is a fingerprint of English.

Compare this with the shift cipher's 26 keys. Ten thousand trillion times more keys, and the same attack works. Key length is not the same thing as security.
How to Solve One by Hand

The order that works, and the one the panels above support:

  • Start with the tallest bar. The most common ciphertext letter is usually E, then T, A, O, I, N.
  • Use the short words. A one-letter word is A or I. The commonest three-letter word by a distance is THE — and it hands you three letters at once.
  • Chase the digrams. If you think you have T and H, look for the pair TH; it should be the most common in the text.
  • Use doubled letters. A doubled letter is most likely LL, EE, SS or OO.
  • Then guess whole words. Once six or seven letters are placed, partially-revealed words become readable and each one you finish gives more letters.
This is why every modern cipher is built to make the ciphertext look uniformly random. If any statistic of the plaintext survives encryption, it is a foothold.
Put It Into Practice

The tool shows the mechanism — the slides show why it is built that way.

Solve your first cryptogram

Frequency analysis is the oldest idea in cryptanalysis and still the clearest. One-on-one tutoring walks you through a full solve, then shows exactly what modern ciphers do to prevent it.

Book a Free Consultation →