Lesson 2

The Caesar Cipher

Shift every letter by the same amount — the first cipher ever used in battle

How it works

The Caesar cipher is the simplest cipher in the world:

Pick a number. Shift every letter of your message forward in the alphabet by that many steps.

If your shift is 3, then:

PlainABCDEFXYZ
CipherDEFGHIABC

When you run off the end (X, Y, Z), you just wrap around back to A.

The number you picked — 3 — is the key. Your friend needs it to un-scramble the message.

Try the cipher wheel

Type a message and drag the shift slider. Watch the inner wheel turn — that’s exactly the same trick.

3

Decoding

To decode, you do the opposite — shift backwards by the same number.

Try the wheel above and flip to “Decode” — notice how it un-scrambles!

Strengths and weaknesses

The Caesar cipher was strong in Caesar’s day — most soldiers could barely read, so shifting letters was enough to stump them.

But there’s a serious weakness: there are only 25 possible keys. You could try all of them in a few minutes and eventually read the message. Computers can try all 25 in a millisecond.

That means today, the Caesar cipher is fun but not secure. We’ll learn stronger ones soon.

Practice

With a shift of 5, what does the letter A become?

You receive the ciphertext WKLV LV IXQ (shift 3). Decode it.

Why is the Caesar cipher easy to break with a computer?

You used shift 7 to encode a message. What shift does your friend use to decode it?


Challenge

Quick-Fire Round

Score: 0 / 5 Problem 1 of 5