Substitution Cipher
Every letter gets its own unique stand-in.
Substitution Cipher
A monoalphabetic substitution cipher replaces each letter with a different, fixed letter. Instead of shifting the alphabet by a constant, each source letter gets its own unique stand-in. With 26 letters there are 26! ≈ 4 × 10²⁶ possible mappings — far more than Caesar's 26. Yet substitution ciphers are trivially broken by any competent cryptanalyst.
Analogy
Think of a personal shorthand, like the squiggles a courtroom stenographer invents for themselves — every letter has its own private symbol, and the system is useless to anyone without the key. The problem is that even a stranger, given a long enough page, can notice which squiggle shows up most often (almost certainly "E"), which pair repeats constantly (probably "TH"), and which three-letter run recurs everywhere (probably "THE"). The shorthand feels impenetrable, but the underlying rhythms of English leak through no matter how exotic the symbols are.
The mapping
A substitution map is a bijection from the 26-letter alphabet to itself:
| Plaintext | A | B | C | D | … | Z |
|---|---|---|---|---|---|---|
| Ciphertext | Q | W | E | R | … | M |
Every source letter maps to exactly one target, and every target is used exactly once.
Encryption: look up the source letter in the map.
Decryption: invert the map and look up the ciphertext letter.
Why the huge key space doesn't help
26! ≈ 4 × 10²⁶ keys is a genuinely large number. Brute force is impossible. Frequency analysis makes the key space irrelevant.
English letter frequencies never change. E appears roughly 12.7% of the time, T roughly 9.1%, A roughly 8.2%, regardless of which substitution map is applied. The ciphertext inherits those same frequencies with the letters renamed. One frequency count of the ciphertext reveals the likely mapping for the most common letters. A few guesses for common short words — THE, AND, FOR — confirm or correct the mapping. The full plaintext follows from pattern matching.
Frequency table
| Rank | Letter | Frequency |
|---|---|---|
| 1 | E | 12.7% |
| 2 | T | 9.1% |
| 3 | A | 8.2% |
| 4 | O | 7.5% |
| 5 | I | 7.0% |
| 6 | N | 6.7% |
| 7 | S | 6.3% |
| 8 | H | 6.1% |
| 9 | R | 6.0% |
| 10 | D | 4.3% |
Playground — crack the cipher
The playground gives you a fixed ciphertext and a blank mapping. Assign letters one at a time. The decrypted text renders live as you fill in the map. The frequency panel shows the ciphertext letter distribution and your current assignment, so you can see which ciphertext letters are candidates for E, T, A, and so on.
There is no brute force here — the key space is too large. Use your eye, the frequency panel, and short-word pattern matching.
Visualizer
The frequency bar chart shows ciphertext letter frequencies alongside English expected frequencies. As you assign letters, the chart redraws with your current hypothesis applied.