Tech●●●●●Difficulty 1 of 5

How did Julius Caesar keep his letters secret by shifting the alphabet?

Caesar's code had a secret you could count on your fingers: a single number from 1 to 25. That is also why anyone can crack it in a minute.

▶ Start the story

Julius Caesar hid his military messages with one of the simplest codes there is: swap every letter for the one three places further along the alphabet, so A becomes D and E becomes H. That is how the Roman historian Suetonius describes it. The reader slides every letter back by three and the message appears. Today it is called a Caesar cipher: a substitution cipher where each letter is replaced by one a fixed number of positions along.

Caesar's shift of three
  1. Step 1: Write the message

    Each letter is looked up in the plain alphabet

  2. Step 2: Slide each letter three places

    A becomes D, E becomes H: the shift is the key

  3. Step 3: Send the scrambled text

    Only someone who knows the shift reads it at a glance

  4. Step 4: Slide each letter back

    The receiver reverses the shift to read it

The whole secret is one number, and that is its weakness. In English there are only 25 possible shifts, so an enemy can try them all and keep the one that reads as real language. Take the scrambled text exxegoexsrgi: the shift of four turns it into attackatonce, and none of the other tries makes any sense. Nobody knows how well the cipher fooled Caesar's rivals, because there is no record of how Romans solved simple substitution ciphers. The earliest surviving records date from the 9th century, when Al-Kindi discovered frequency analysis.

The idea refuses to die anyway. Suetonius writes that Caesar's nephew Augustus used a shift of just one, and didn't even wrap the alphabet around: he replaced Z with AA. In 1915 the Russian army used a Caesar cipher because its troops found harder ciphers difficult to master, and German and Austrian codebreakers had little trouble reading the messages. In 2006 the Mafia boss Bernardo Provenzano was captured in Sicily partly because some of his messages, clumsily written in a variation of the cipher, were broken. And you can still find it in children's secret decoder rings.

25

possible shifts in English: all an attacker has to try

Quiz me

0/3

  1. 1.Why can a Caesar cipher be broken so easily, even without knowing the shift?
  2. 2.What happens if you encrypt a message with a Caesar shift of 5 and then again with a shift of 8?
  3. 3.What is the Vigenère cipher, built from Caesar's idea?

Recap

A Caesar cipher hides messages by sliding every letter along the alphabet, but with only 25 possible shifts the secret can be found by trying them all.

💡 A trick to remember it · A lock with only 25 possible combinations isn't a lock, it's a quick game of try-them-all.

Surprising fact · A Mafia boss was captured in 2006 partly because his messages were written in a clumsy variation of Caesar's cipher.

Sources (2)

No source, no claim. Every fact in this lesson (17 claims) cites at least one of these.

  1. [1]Caesar cipher · Wikipedia
  2. [2]ROT13 · Wikipedia
More lessons in 💻 Tech (3) See all tech lessons →

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson ↗