📜 Classical Ciphers
Where cryptography started — and why it all broke⏱ ~4 min
Classical ciphers are the ancestors of modern cryptography. They're mathematically simple and all eventually broken, but studying them reveals the fundamental concepts that modern ciphers evolved from.
Caesar Cipher — Shift Everything by N
Imagine the 26 letters of the alphabet written on a wheel. You rotate the wheel by 3 positions. Now A becomes D, B becomes E, Z becomes C. To decrypt, rotate back by 3. Julius Caesar used this to encrypt military orders. The key is just a number: how many positions to shift.
Key = 3 (shift right by 3) Plaintext: HELLO WORLDCiphertext: KHOOR ZRUOG H→K E→H L→O L→O O→RW→Z O→R R→U L→O D→GSubstitution Cipher — Replace Each Letter with Another
Instead of shifting by a fixed amount, a substitution cipher uses a scrambled alphabet as the key. A→Q, B→Z, C→M, etc. This gives 26! possible keys — a huge number. Yet it was broken in the 9th century.
Vigenère Cipher — Polyalphabetic Substitution
The Vigenère cipher uses a keyword to apply different Caesar shifts to each letter. The keyword repeats. 'CRYPTO' as the key means the 1st letter shifts by C(2), 2nd by R(17), 3rd by Y(24), and so on. This defeats single-letter frequency analysis — but the repeating key creates patterns that Charles Babbage cracked in 1854.
One-Time Pad — Theoretically Perfect
What Classical Ciphers Teach Us
- •Key space must be enormous — brute force must be computationally infeasible
- •Patterns in plaintext must not survive into ciphertext — statistical analysis must fail
- •The algorithm being known doesn't matter — only the key must be secret (Kerckhoffs's principle)
- •Key distribution is the hard problem — how do two strangers agree on a key without meeting?
How was the substitution cipher broken in the 9th century?