Crack a Secret Message: From Caesar to Vigenère

How the oldest ciphers work, why letter counts give them away, and how to break a Caesar or Vigenère message yourself in a few minutes.
People have hidden messages for as long as they have written them, and other people have tried to read them for just as long. Classic ciphers are a great way to learn how secrets are kept and lost, and you can try every one of them in the new Classical cipher lab.
The Caesar shift
Julius Caesar is said to have moved each letter three places along the alphabet: A becomes D, B becomes E, and so on. So meet me at noon turns into phhw ph dw qrrq.
It looks scrambled, but there are only 25 useful shifts. Try them all and one will read as English. ROT13, still used online to hide spoilers, is simply a shift of 13.
Why letter counts give the game away
In English, E is the most common letter, then T, A and O. A Caesar or keyword cipher swaps letters but keeps those counts. In a long secret message, the most common letter is probably E in disguise.
That is how the cipher lab cracks messages: it tries every key and scores each result by how closely its letter counts match normal English. The lowest score is almost always the answer.
Open the Letter frequencies tab and paste in any English paragraph. You will see E near the top nearly every time.
Vigenère: the cipher that held out for 300 years
The Vigenère cipher uses a key word. With the key LEMON, the first letter is shifted by L (11 places), the second by E (4), then M, O, N, and round again. Each letter of the message can be disguised in five different ways, so simple letter counts stop working.
The weakness is the repeating key. Take every fifth letter and they were all shifted by the same amount, so each group falls like a small Caesar cipher. The hard part is guessing the key length, and there is a neat trick for that.
- Split the message into columns for a guessed key length.
- Measure how "English-like" each column is with the index of coincidence: about 0.066 for English, about 0.038 for random letters.
- The right length makes every column score high. Then crack each column as a Caesar shift.
The cipher lab does all three steps and shows its working. It needs enough text: a few hundred letters is good, under 100 and the guess may be wrong.
Try it with a friend
- One of you picks a cipher and a key, encrypts a paragraph and sends only the result.
- The other pastes it into Crack a message and sees how long the secret lasts.
- Then try a transposition cipher such as the rail fence. It only moves letters around, so the counts look exactly like English, and the cracking tools cannot help.
None of these ciphers is safe for real secrets today. For a real private file, use proper modern encryption such as the AES encryption in our Text and file encryptor.
The Classical cipher lab, Cryptogram puzzles and the other tools beside this post are free to use and run entirely in your browser.