> CAESAR CIPHER
The idea in plain English: Write the alphabet on a strip of paper. Then shift it a few letters to the right. A becomes D, B becomes E, C becomes F, and so on. When you reach Z, wrap back around to A. That's it — that's the whole cipher. To decode, just shift backwards by the same amount.
▸ Visual: Shift by 3
Why this really exists: Julius Caesar used this cipher for military communications in ~50 BC. Today it's useless for real security (anyone can try all 25 shifts in seconds), but the core idea — substitution — is the foundation of all modern encryption. Your bank's HTTPS connection uses substitution at a much more complex level.
▸ Concrete Example
You receive the message "KHOOR" with shift hint = 3. Let's decode it:
H ← shift back 3 → E
O ← shift back 3 → L
O ← shift back 3 → L
R ← shift back 3 → O
Result: "HELLO"
Each letter moves backwards in the alphabet by 3 positions. K→J→I→H, O→N→M→L, etc. To encode, you'd shift forward instead. Encrypt and decrypt are the same operation, just in opposite directions.
▸ How to Decode (Step by Step)
1. Find the shift number (given in the puzzle data or hint)
2. For each letter in the ciphertext, subtract the shift from its position
3. If the result is less than 'A' (0), wrap around by adding 26
4. Convert the resulting number back to a letter
plain = ''.join(chr((ord(c) - 65 - shift) % 26 + 65) for c in ciphertext)
💡 If no shift hint is given, try all 25 possible shifts. One of them will produce readable English — that's your answer.
▸ Real-World Applications
- ROT13 (a Caesar shift of 13) is still used today to hide spoilers and puzzle answers in online forums
- Secret decoder rings in cereal boxes — millions of kids learned cryptography this way
- Teaching cryptography — every intro to crypto course starts with the Caesar cipher
- Children's puzzles in newspapers and activity books still use shift ciphers