A mini-course on cryptography
The Black Chamber
How letters were hidden from Caesar to HTTPS — and how they were read anyway. Twelve lessons in plain words, live diagrams, puzzles with walkthroughs, a tool for every cipher and a quest of eight doors.
Twelve lessons
From ciphers a pencil can break to mathematics nobody breaks. Each lesson takes 15–25 minutes and has its own diagram and its own puzzle at the end.
- №01 1st century BC The Caesar cipher The most famous cipher in history, and the most defenceless one. How it works, and how to break it in a minute without the key.
- №02 9th century Substitution and frequency analysis Shuffle the alphabet any way you like and there are more keys than stars in the sky. Yet in the ninth century al-Kindi showed that the letters themselves give such a cipher away. Let's learn to break it by counting.
- №03 16th–19th century The Vigenère cipher The cipher people called unbreakable for three centuries. We take apart the Vigenère square, watch a key flatten the letter frequencies, and then break it the way Babbage and Kasiski did.
- №04 5th century BC Transposition: scytale, rail fence, columns You can leave every letter untouched and still make a message unreadable: just shuffle them. We wind a strip round a Spartan rod, write in a zigzag and reorder columns by a keyword.
- №05 1840s Morse code Two marks, a short one and a long one, and a rule for how long to stay silent between them. That was enough to wire up the world, call for help from a sinking ship and flash messages from bridge to bridge.
- №06 20th century Binary, hex and Base64 A computer knows no letters, only zeros and ones. Let’s see how text turns into bytes, what hex and Base64 are for, and why a string that looks like gibberish isn’t a cipher yet.
- №07 5th century BC to today Steganography A cipher hides what a letter says, but everyone can see there is a letter. Steganography hides the letter itself: under a messenger's hair, beneath wax, in the lowest bits of a photo, in a sound you can see.
- №08 1920–1945 The Enigma machine A cipher machine its makers believed could not be broken. We take it apart — rotors, reflector, plugboard — and find the tiny quirk that brought it down.
- №09 1917–1980 XOR and the one-time pad The only cipher that can’t be broken even in theory, and the story of how it was broken anyway, because someone saved on paper.
- №10 1979–2017 Hashes: fingerprints of data A function that turns anything into a short string and won’t let you go back. Passwords, downloads and signatures all rest on it. Here’s how it gets fooled, and how people defend it.
- №11 1976–1977 Public keys: Diffie–Hellman and RSA How do you agree on a secret with a stranger when someone is listening from the very first word? For three thousand years it seemed impossible. In 1976 it turned out it wasn’t.
- №12 1586 to today Famous ciphers A cipher that sent a queen to the scaffold. A telegram that pulled America into a war. A killer who taunted the police in code. A sculpture in the CIA's courtyard. A treasure that may never have existed. Five case files from the Black Chamber.
Quest
Eight Doors
A chain of ciphers: each answer is the password to the next door. Caesar’s note, a Morse radiogram, a word painted into sound, a password in a photo’s pixels, XOR and a safe locked with RSA. Everyone gets their own puzzles, solved the same way — fair for all.
Open the first doornobody yet
- 1 Caesar
- 2 Morse
- 3 Vigenère
- 4 Encodings
- 5 Spectrogram
- 6 Steganography
- 7 XOR
- 8 RSA
The Chamber’s tools
Encode, decode, crack, listen, look. Everything runs in your browser: your texts go nowhere.
Classical ciphers
- Caesar cipher online Encode and decode the Caesar cipher and ROT13, try every shift at once and spot the one that reads.
- Atbash cipher Atbash: the alphabet read backwards. Works for Latin and Cyrillic.
- Substitution cipher Keyword or custom-alphabet substitution: encode, decode and crack letter by letter.
- Affine cipher The affine cipher E(x) = a·x + b: encode, decode and brute-force every key.
- Vigenère cipher: encoder and cracker Vigenère and Beaufort: encode with a key, or crack without one — key length from the index of coincidence.
- Playfair cipher Playfair: the 5×5 key square and digraph encryption with each rule highlighted.
- Polybius square and tap code The Polybius square: letters to digit pairs and back, the prisoners’ tap code and ADFGX.
- Pigpen cipher The Freemasons’ pigpen cipher: letters in grids and crosses. Type text or decode by clicking symbols.
- Rail fence cipher The rail fence: text zigzags across rails. See each letter land, and brute-force the rail count.
- Columnar transposition Keyword columnar transposition: the grid, the column order, encryption and decryption.
Analysis and cracking
Codes and encodings
- Letters to numbers (A1Z26) Letter positions: A=1, B=2… and back, for Latin and the 33-letter Russian alphabet.
- Morse code translator with sound Text to Morse and back, played as sound and light, and decoding Morse from an audio file.
- Base64, hex and binary Convert text to and from Base64, Base32, hex, binary and decimal bytes (UTF-8).
Modern cryptography
- XOR cipher online XOR text or bytes with a key in hex, Base64 or text, and brute-force a single-byte key.
- Hash generator: SHA-256, MD5 MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32 of text or a file, with the avalanche effect shown.
- AES password encryption Encrypt text with a password (AES-256-GCM, key from PBKDF2) and decrypt it. All in your browser.
- RSA calculator for learning RSA with small numbers: primes p and q, keys, encryption and decryption, factoring n.
Machines and secret writing
- Bacon’s cipher Francis Bacon’s cipher: each letter becomes five A/B marks that can hide in the typeface of an innocent text.
- Enigma machine simulator Enigma I: rotors I–V, ring settings, reflector B/C and plugboard, with the current’s path for every key.
- Audio spectrogram viewer See the spectrogram of an audio file and hide your own picture or text in a sound.
- Image steganography (LSB) Hide text in the least significant bits of a PNG and get it back; view an image’s bit planes.
Hall of fame
Nobody has opened all eight doors yet. First place is free.