Quiz Entry - updated: 2026.08.02
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: every letter shifted by a fixed amount (+3). *
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).
Go deeper:
Caesar cipher - the shift-substitution cipher, with modular formula and cryptanalysis.
dCode Caesar Cipher - encode/decode and brute-force all 26 shifts interactively.