Cryptography
Math · Intermediate · Lesson 3 of 7

The One-Time Pad

A provably unbreakable code

An interactive lesson with 6 steps, about 5 minutes: you predict, drag and solve, with instant feedback on every answer. It runs in your browser and needs JavaScript.

What you’ll learn

  • A one-time pad combines the message with a random key of equal length (e.g. by XOR).
  • It has perfect secrecy, proved by Shannon.
  • Reusing the key destroys its security.

Steps

  1. A key as long as the message
  2. XOR by hand
  3. Why it’s unbreakable
  4. Two-time pad
  5. Any message fits
  6. Key material