Ciphertext
Reading
Nothing to read yet.
Readout
What these mean
IC is the chance that two letters picked at random from the text are the same one. English sits near ; a text enciphered with several alphabets falls towards 0.0385, which is what random letters give. The white tick marks English.
χ²/N compares the letter counts to English letter counts. Near zero means the frequencies are already English — the letters were rearranged, not replaced.
fit is the average log₁₀ probability of each four-letter run under English statistics. English text measures about −4.1; nothing enciphered has ever measured above −5.2 here, and pure noise sits near −8.4. The tick marks that −5.2 line.
Letter frequencies amber = English
Cryptogram
Tap a letter, then the letter you think it stands for. Same cipher letter, same answer everywhere.
Your alphabet click a slot, then a letter
This one
Solve it by working out which letter each one stands for. Every puzzle is a sentence from a public-domain book.
Your record
Fits this word
Most constrained words
Plaintext
Ciphertext
How hard did you make it
How the identification works
Every classical cipher leaves a fingerprint in the statistics, and three numbers are enough to tell most of them apart.
The index of coincidence is the probability that two letters drawn at random from a text are the same letter. English runs around 0.066 because a fifth of it is E and T. Random letters give 1/26 = 0.0385. Replacing each letter with another letter — Caesar, affine, any substitution — does not change the number at all, because it just relabels the buckets. Rearranging the letters does not change it either. But enciphering with several alphabets in rotation, as Vigenère does, flattens the distribution and drags the index towards random. So: high index means one alphabet, low index means many.
Chi-squared against English letter frequencies separates the two high-index cases. A transposition moves letters around without changing which letters are present, so its frequencies are still English and chi-squared stays near zero. A substitution swaps the labels, so its frequencies are English-shaped but attached to the wrong letters, and chi-squared is large.
Quadgram fitness settles what is left. It scores a text by how likely its four-letter runs are in English — TION is common, QKZJ is not. Measured over 300 samples at each of seven lengths, plain English scored between −4.4 and −3.8 and nothing enciphered ever got above −5.9, so this page draws the line at −5.2. It is also the score the solver climbs.
When the index is low, slicing the text into every second letter, every third letter and so on and measuring the index of each slice finds the key length: at the right period each slice was enciphered with a single alphabet, so its index jumps back up to English.
How the substitution solver works
There are 26! keys — about 4×10²⁶ — so nothing is brute-forced. The solver starts from a key that matches the commonest ciphertext letters to the commonest English ones, then repeatedly swaps two letters of the key at random. A swap that raises the quadgram fitness is kept; a swap that lowers it is kept anyway with a probability that falls as the run cools. That last part is what lets it climb out of a key that is nearly right but stuck. It restarts from scratch many times and keeps the best key it ever saw.
It is a search, not a proof, and it fails in a predictable way: short texts. These are measured numbers — 200 enciphered sentences per bucket, run through the solver on this page at the settings the Auto-solve button uses:
Below about 80 letters there is often simply not enough evidence to prefer the true key over a plausible wrong one, and no amount of extra searching fixes that.
Nudge runs seven searches from different starting points and hands you only the letters that at least six of them agreed on. Agreement is evidence, not proof — measured on the same texts:
A crib is worth more than the search. Give it one word you are sure appears, and it lays that word over every position it could occupy, finishes each one with a short search of its own, and ranks them by how English the rest of the text becomes. On the same ciphertexts, using a word actually present in the plaintext:
At 40 to 70 letters that is the difference between a coin toss and a near certainty. One word you can guess really is worth more than a million iterations.
Working one by hand
Click any letter in the text to select it, then press the letter you think it stands for. Every instance updates at once. Press Enter to lock a letter you are sure of; locked letters survive the auto-solver and the clear button.
Fits this word lists dictionary words with the same repeat pattern as the selected word, filtered to those that agree with every assignment you have already made. Most constrained words ranks the whole text by how few words could possibly fit — the top of that list is usually the best next move.
Crib takes a word you believe is in the message and finds every position where laying it over the ciphertext would not contradict itself, or any letter you have locked. Each placement then gets a short solver run of its own, and they are listed by how English the rest of the text becomes — the right placement usually stands more than a point clear of the others. Picking one locks those letters in. This is how the real thing was done.
The ciphers
Caesar shifts every letter by the same amount. 26 keys; solved instantly.
Atbash reverses the alphabet. One key.
Affine maps each letter p to ap+b, with a coprime to 26. 312 keys.
Substitution uses an arbitrary permutation of the alphabet. 26! keys.
Vigenère shifts by a repeating keyword. Beaufort subtracts the plaintext from the key instead, which makes it its own inverse.
Columnar transposition writes the text into rows under a keyword and reads the columns off in alphabetical order of the keyword.
Rail fence writes the text in a zigzag across a number of lines and reads the lines off in order.
Where the data came from
The quadgram table, the word list and the puzzle sentences are all built from public-domain books on Project Gutenberg — . Everything is embedded in this page; it makes no network requests and works offline.