Lion Cipher Lab

Break a classical cipher with frequency analysis (and learn why modern crypto is different)

Why it matters

Almost everything you do online is protected by cryptography -- the padlock in your browser, your messages, your passwords at rest. To trust it, it helps to first see a cipher BREAK, and to understand why. For roughly two thousand years, the best secret-writing anyone had was a classical cipher: shift every letter along the alphabet (a Caesar cipher), or swap each letter for some other fixed letter (a substitution cipher). They feel unbreakable -- a substitution has about four hundred trillion trillion possible keys, a number you could not brute-force before the heat death of the universe.…

What you'll learn

Steps in this lab

  1. The handful of words you need first
  2. Set up, and save the Caesar program
  3. Run it: watch an unreadable message read itself
  4. Why chi-squared is the right judge
  5. The honest catch: too few letters and it fails
  6. Step up: a full substitution and its 400 trillion trillion keys
  7. Run it: the enormous key space falls anyway
  8. Why modern crypto is built differently -- and the two laws behind it
  9. When classical ciphers are still worth knowing -- and when they are never OK
  10. What you built, and the reflex to keep

Open the full interactive lab →