Cracking a Substitution Cipher
About this app
Frequency analysis, hands-on: the ciphertext sits on top, a mirror chart below. Ciphertext frequencies grow upwards, the German distribution hangs downwards, and the assignment strip lies in between. Letters are assigned by dragging or tapping, and the plaintext appears bit by bit. Three levels: Caesar with a shift slider, substitution with visible spaces, and the 27-symbol version from the slide. Despite 27! ≈ 10²⁸ keys, six assignments make SIE, IN and ES readable. With Hint and Check.
Why substitution is insecure
In a monoalphabetic substitution each letter is always replaced by the same symbol. The Caesar cipher is the special case where all letters are shifted by the same number k. A general substitution over 27 symbols has 27! ≈ 10²⁸ possible keys, far too many to try. Yet it is easy to break, because letter frequencies survive encryption. In German, E is by far the most common letter, followed by N, I, S, R and A. Mapping the most frequent cipher symbols accordingly soon reveals the first words.
What the app shows
The ciphertext is at the top, and mapped symbols appear as plaintext. Below is a mirror chart: ciphertext frequencies grow upwards, the German distribution hangs downwards, and the mapping bar lies between them. Lines connect the pairs and cross where the ranking differs. There are three levels: Caesar with a k slider, substitution with spaces, and a 27-symbol version in which the space is also replaced. Hint and check buttons help along the way. The texts are in German.
Try it yourself
In level 1, move the k slider until the two profiles line up: the tallest ciphertext bar probably belongs to E. In the substitution levels you drag letters onto cipher symbols or tap them. Start with the most frequent symbol. After about six mappings, words like SIE, IN and ES become readable, and those words confirm the rest. Keep in mind that the ranking is only a guess; in short texts it varies.
Frequently asked questions
- How do you break a Caesar cipher?
- Count the letters in the ciphertext and find the most frequent one. In German or English that is usually a shifted E. The distance to E gives the shift k, which decrypts the whole text. Alternatively, simply try all 25 possible shifts.
- What is frequency analysis in cryptography?
- Frequency analysis compares how often symbols occur in the ciphertext with the known letter distribution of the language. Simple substitutions preserve this distribution. Cipher symbols can thus be matched to their likely plaintext letters.
- What is the most common letter in German?
- E is by far the most common letter in German, at about 17 percent. It is typically followed by N, I, S, R and A. The order of the lower ranks can vary from text to text.
- Which levels does the app have?
- Three: Caesar with a shift slider, a substitution with visible spaces, and a 27-symbol version in which the space is encrypted too. Each level offers hints and a check function.
Subject: Cryptography
More from Cryptography
- The Nonce Lottery
- Hashing & collisions
- Pseudorandomness — how a computer rolls dice
- SHA-256 in slow motion (8-bit model)
- Encrypt and Sign with Two Keys
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps