Quiz Entry - updated: 2026.03.01
How does the Caesar cipher work?
Each letter is shifted by a fixed number of positions in the alphabet — e.g., with shift 3, A becomes D.
The Caesar cipher (used by Julius Caesar around 50 BC) is a substitution cipher:
- Encryption: shift each letter forward by the key value
- Key = 3: A → D, B → E, C → F, ..., Z → C
- Decryption: shift each letter backward by the same amount
Mathematically (using $\bmod 26$ arithmetic):
- Encrypt: $c = (m + r) \bmod 26$
- Decrypt: $m = (c - r) \bmod 26$
Where $m$ = plaintext letter, $c$ = ciphertext letter, $r$ = key (shift amount).
Why it's trivially breakable: There are only 26 possible keys (shifts 0-25). An attacker can try all of them in seconds — this is called a brute force attack. Additionally, frequency analysis instantly reveals the shift by looking at which letter appears most often (likely 'E' in English).