Calculator
Key tools
A keyed alphabet uses the keyword's unique letters, then appends the unused letters. This is still one fixed substitution, not a Vigenère key.
Automatic substitution solving is unreliable on very short ciphertext. More text usually produces better results.
Advanced hints
A word or phrase you believe is in the plaintext, anywhere. Every position it could occupy without breaking the one-to-one rule is tried. Letters you lock in the workspace below are also held fixed.
Background searching is not available here, most likely because this page was opened as a file instead of from a web server. Searches still work, but the page pauses while one runs, shows no progress, and cannot be stopped; Maximum effort can take a while.
Recovered key, cipher → plain: each ciphertext letter above the plaintext letter it stands for; a dot marks a letter that does not occur in the ciphertext.
Show the equivalent encryption alphabet (plain → cipher)
The cipher letters for plain A, B, C, …, Z, as the Cipher alphabet field of Encrypt mode would hold them; ? where the ciphertext does not say.
Several plausible solutions were found. More ciphertext or known mappings may improve the result.
Search details
Manual solving workspace
Cipher letter → plain letter. Type a guess beside any ciphertext letter and the plaintext guess above updates at once, with ? for letters not yet guessed. Lock the guesses you trust: the solver never changes a locked letter, and uses the unlocked ones only as a starting point.
A plain letter can belong to one ciphertext letter only: giving it to another moves it, and the two letters trade guesses. A locked letter cannot be taken or changed until it is unlocked. Faded letters do not occur in the ciphertext. "Decrypt with this mapping" becomes available once every ciphertext letter in use has a guess.
Frequency analysis
Enter some ciphertext to see how often each letter occurs.
| Cipher | Count | Frequency | English, same rank | Your guess | Try |
|---|
The most frequent ciphertext letter is often, not always, E; the next few are usually among T, A, O, I, N, S, H, R. Matching by rank is evidence, not certainty, and it is weakest for the rare letters and on short texts. In English the commonest bigrams are TH, HE, IN, ER, AN, RE and the commonest trigrams THE, AND, ING, ENT, ION. Sequences are counted inside words, and the last column of each list shows how it reads under your current guesses.
Word patterns
A substitution keeps the pattern of repeated letters in a word: NOON and its ciphertext both read 0 1 1 0. Choose a ciphertext word to see the dictionary words with the same pattern.
Enter some ciphertext with spaces between its words.
See the mapping
Edit the cipher row to change the key. A letter typed into a cell trades places with the cell that held it, so the key stays one-to-one.
How your message is transformed
| Position | Input | Mapping | Output |
|---|
Position counts letters only; spaces, digits, and punctuation are not transformed and are left out of the table. There is no arithmetic here: each letter is simply looked up in the key.
Why must the key be a permutation?
Every plaintext letter must map to exactly one ciphertext letter, and every ciphertext letter must come from exactly one plaintext letter. Otherwise the message could not be decrypted uniquely.
That is why the key editor swaps letters instead of letting one appear twice.
How large is the key space?
There are 26! = 403,291,461,126,605,635,584,000,000 ≈ 4.03 × 10²⁶ possible keys: 26 choices for A, 25 left for B, and so on. Trying every key is not practical; at a billion keys a second it would take about thirteen billion years.
A substitution cipher is weak all the same, because it is attacked without trying keys one by one: with language statistics, frequency analysis, repeated-letter patterns in words, and heuristic search that improves a guessed key step by step. That is what Break mode does.
Why does frequency analysis work?
A substitution cipher is monoalphabetic: every occurrence of a plaintext letter becomes the same ciphertext letter. The letter counts of the message are therefore preserved, only attached to different letters. If E occurs 15 times and E → T, then T occurs 15 times in the ciphertext, and English has a very uneven and well-known letter distribution to compare it with.
Related topics
The Caesar Cipher and the Affine Cipher are special, structured monoalphabetic substitutions: their cipher alphabets come from a formula with one or two numbers. A general substitution cipher allows any permutation of the alphabet.
The Vigenère Cipher is different in kind: it is polyalphabetic, so the same plaintext letter can become different ciphertext letters.