Back

All study guides

Secret codes and ciphers

Years 9 to 13

A Caesar cipher shifts every letter along the alphabet. Remainders make the alphabet wrap round, and modern codes use the same idea with huge numbers.

ADBECFDGEHFIGJHKILJMKNLOMPShift of 3: A → D, B → E, C → F …(first half of the alphabet shown)
A shift of 3: every letter in the top row becomes the letter below it.

For learners

A Caesar cipher hides a message by moving every letter along the alphabet by the same amount. With a shift of 3, A becomes D and B becomes E.

To read the message, the receiver moves every letter back by 3. The shift is the secret key.

After Z, you go back round to A. Counting round like a clock is called modular arithmetic.

A worked example

Encrypt the letter X with a shift of 5.

  1. X is at position 23 (A is 0).
  2. , which is past 25.
  3. , and position 2 is C.

For grown-ups

Caesar ciphers are easy to crack because there are only 25 possible shifts, but they show the key ideas: a key, encrypting and decrypting. Number the letters from 0 and use 'remainder after dividing by 26' to wrap round. Modern encryption uses the same kind of remainder arithmetic, with very large numbers.

Common mistakes

  • Not wrapping round after Z.
  • Decrypting by shifting forward instead of back.
  • Forgetting that the same shift must be used for every letter.

Why it matters

Every time you pay online or send a private message, encryption keeps it safe.

Topics in quarter that use this

  • Secret codes: Caesar cipher
  • Information and bits

Read more