Caesar cipher: how it is broken
Brute force, frequency analysis and known plaintext: three ways to break the Caesar cipher, each faster than the last.
The Caesar cipher falls to any attack, even by hand. It is an excellent training ground for understanding techniques that, in far more sophisticated forms, are still used against modern ciphers.
- 01
Brute force
Try all 25 keys and see which produces meaningful text. By hand it takes a few minutes, by computer a fraction of a second.
- 02
Frequency analysis
In English the most frequent letter is E (in Italian E, A, I and O). If the most common letter in the ciphertext is H, it probably stands for E: the key is 3.
- 03
Known plaintext
Knowing a single pair of plain letter and cipher letter — for example that the message starts with the recipient’s name — immediately reveals the key.
The lesson of frequency analysis
The Arab mathematician al-Kindi, in the 9th century, was the first to describe frequency analysis: every language uses some letters more than others, and a substitution that always turns the same letter into the same letter preserves this pattern. That is why frequency analysis breaks not only the Caesar cipher but any monoalphabetic substitution, even with a randomly shuffled alphabet.
Against modern ciphers
Modern algorithms are designed precisely to withstand these attacks: huge keys against brute force, output that looks random against statistical analysis, resistance to known-plaintext or even chosen-plaintext attacks.
Caesar cipher: today’s uses
ROT13, puzzles, teaching and obfuscation: where the Caesar cipher still turns up, and where it must never be used.
The pages of this topic
Back to the overviewCaesar cipher: the history
Suetonius, Julius Caesar, Augustus and letters written in Greek characters: what we really know about Roman ciphers.
Caesar cipher: how it works
Two alphabets side by side, one shifted: the mechanism of encryption and decryption step by step.
Caesar cipher: a worked example
Let us encrypt and decrypt VENI VIDI VICI with key 3, letter by letter.
Caesar cipher: the maths
Modular arithmetic, encryption and decryption formulas, key space: the Caesar cipher written as formulas.
Caesar cipher: try it yourself
Three exercises to solve with pen and paper: encrypt, decrypt with the key, and break a message without the key.
Caesar cipher: frequently asked questions
Short answers to the most common doubts about the Caesar cipher and its variants.