Fundamentals · 1.2

📜 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

🔄Caesar cipher = rotating the alphabet

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.

text
Key = 3 (shift right by 3)
Plaintext: HELLO WORLD
Ciphertext: KHOOR ZRUOG
H→K E→H L→O L→O O→R
W→Z O→R R→U L→O D→G
⚠ WarningCaesar cipher has only 25 possible keys. An attacker can try all 25 in seconds — or even by hand. This is called a brute-force attack. Any cipher with a tiny key space is trivially broken.

Substitution 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.

★ FactArabic mathematician Al-Kindi broke substitution ciphers around 850 CE using frequency analysis — in English, E appears 13% of the time, T 9%, A 8%. The most frequent letter in the ciphertext is almost certainly E. Patterns in language break patterns in the cipher.

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

🔒 SecurityThe one-time pad (OTP) is the only cipher mathematically proven to be unbreakable. Rules: the key must be (1) truly random, (2) at least as long as the message, and (3) never reused. XOR each bit of the plaintext with a corresponding key bit. Without the key, the ciphertext reveals nothing about the plaintext. The problem: key distribution is as hard as securely sending the message itself.

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?
🧠Quick Checkfirst try = +5 XP

How was the substitution cipher broken in the 9th century?

0 XP🔥 0 days