Caesar cipher · 05 Weaknesses and attacks

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.

  1. 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.

  2. 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.

  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.

Continue with
06 Use today

Caesar cipher: today’s uses

ROT13, puzzles, teaching and obfuscation: where the Caesar cipher still turns up, and where it must never be used.

↑