How-to

How to Solve a Substitution Cipher

6 min read

A systematic way to solve a simple substitution cryptogram using word patterns, letter frequencies, cribs, and a consistent mapping table.

Recognize the kind of substitution

In a simple substitution cipher, every plaintext letter is replaced by one fixed ciphertext letter, and the same mapping is used throughout the message. Spaces and punctuation are usually preserved. Repeated plaintext letters therefore remain repeated, and identical words encrypt identically.

This is broader than a Caesar cipher. Caesar uses one constant shift; a general substitution can use any shuffled alphabet. Testing 26 shifts is enough for Caesar, but an English substitution alphabet has 26! possible arrangements. The practical attack is to reconstruct the mapping from language constraints, not enumerate every key.

Step 1 — Build a pattern worksheet

Copy the ciphertext without changing spacing. Under it, keep one row for tentative plaintext and a two-way table: ciphertext → plaintext and plaintext → ciphertext. Every assignment must be one-to-one; two ciphertext letters cannot represent the same plaintext letter.

Mark each word by its repetition pattern. For example, JTTQ has pattern 0-1-1-2, while KLLK has 0-1-1-0. Candidate words must have exactly the same pattern. Also list one-letter words, double letters, repeated words, apostrophes, and common endings.

Step 2 — Start with high-information clues

Short does not always mean easy. A long word with repeated letters may constrain more mappings than a common three-letter word. Prioritize:

  • words repeated in several positions;
  • double letters and distinctive patterns such as 0-1-1-0;
  • one-letter words, which in English are usually A or I;
  • likely greetings, names, topic words, or fixed phrases;
  • common endings such as -ING, -ED, and -TION.

Treat each guess as a hypothesis. Write it in pencil, propagate its mappings everywhere, and undo it immediately if any word pattern or one-to-one constraint breaks.

Step 3 — Use frequencies as rankings, not answers

On a long English cryptogram, frequent ciphertext letters may correspond to E, T, A, or O; common pairs may reflect TH, HE, IN, or ER. But topic, names, and short samples can change the order.

Use the frequency analysis tool to find promising candidates, then test them against word patterns. A frequency match that creates impossible doubles or breaks several words is weaker than a pattern-supported crib.

Step 4 — Propagate every confirmed mapping

Each reliable word should unlock several others. If you set J→M, replace every J in the message with M. If another guess later requires the same ciphertext letter to mean S, the guesses conflict and at least one must be removed.

Alternate between local and global checks: complete a promising word, propagate its letters, inspect newly exposed fragments, and revisit frequencies. Do not fill an uncertain word merely because it “looks close.” A valid solution uses one consistent alphabet for the entire ciphertext.

Worked mini-example

Consider JTTQ JT SQ KLLK. The word JTTQ has pattern 0-1-1-2. If context suggests MEET, the mappings are J→M, T→E, and Q→T. The repeated word JT then becomes ME, supporting the guess.

The two-letter word SQ now has the form _T; AT fits the sentence, giving S→A. Finally, KLLK has the mirrored pattern 0-1-1-0; NOON fits and yields K→N, L→O. The full plaintext is MEET ME AT NOON. This example was generated and verified with one complete substitution alphabet.

Step 5 — Verify the complete solution

Before accepting the plaintext, check that every occurrence of a ciphertext letter has one meaning, no two plaintext letters share a ciphertext symbol, and every word is explained without ad hoc corrections. Reconstruct the full keyed alphabet, including letters absent from the sample only when the key is known.

The simple substitution tool applies a complete key but does not discover an unknown one for you. Use it to re-encrypt the recovered plaintext: an exact match with the original ciphertext is the strongest mechanical check. If several letters remain unresolved, report the partial mapping instead of inventing certainty.

Frequently asked questions

No. Caesar is the special case where every letter moves by one constant shift. A simple substitution can use any one-to-one permutation of the alphabet.

More text usually makes frequencies and word patterns more reliable. A short cryptogram can still be solvable when it preserves spaces, contains distinctive repetitions, or has strong contextual clues.

Undo the least-supported guess first. Keep confirmed mappings separate from tentative ones, then try another candidate with the same word pattern.

No. Automated scoring can search mappings efficiently, but very short texts, unusual vocabulary, missing spaces, custom alphabets, and multilingual content can leave several plausible solutions.

See also