Home › Ciphers

Ciphers

Type something and watch it disappear.

Try a cipher

Nine ways to hide a message, each one animated a step at a time. Type your own message and press run it. Print the sheets to work on paper.

Rail Fence

Press Run it to start the machine.
0 / 0
Result

How it works

The story

Crack these

Take one apart

Twenty-six of them, each built a step at a time.

Rail Fence
Zig-zag the letters down the rails, then read each rail on its own. Nothing is swapped for anything else.
Open it →
Twisted Path
Write the message into a grid, then collect the letters along a secret path: a plow path, a spiral, or straight up the columns.
Open it →
Key Word Columns
A key word numbers the columns, and the columns come out in that order. Change the key word and the whole cipher changes.
Open it →
Shift Cipher
Slide the whole alphabet along by a secret number. Julius Caesar used this one, and it takes a code-breaker about a minute.
Open it →
Date Shift
The shift changes with every letter, so the same letter rarely looks the same twice. Much harder to break than a plain shift.
Open it →
Key Word Alphabet
Build a scrambled alphabet out of a key word. Nothing to carry, nothing to lose, and you can rebuild it from memory.
Open it →
Pigpen
Every letter becomes the shape of the pen it lives in. The page stops looking like writing at all.
Open it →
Polybius Squares
Turn every letter into two numbers: which row, then which column. A message made of nothing but digits.
Open it →
Lewis Carroll's Table
A square of 26 alphabets. The key word picks a different one for every letter, which is why it held for centuries.
Open it →
Playfair
Letters travel in pairs, so counting single letters tells a code-breaker almost nothing. It lasted into two world wars.
Open it →
Atbash
The alphabet backwards, so A becomes Z. No key at all, and scribes were using it thousands of years ago.
Open it →
Bacon's Cipher
Every letter becomes five units of two kinds, which can then be hidden inside an ordinary sentence.
Open it →
Route with Nulls
A grid where some letters are nonsense on purpose, so even the right path gives a code-breaker noise.
Open it →
Book Cipher
Numbers pointing at words in a book you both own. Nothing to break, because the key is on your shelf.
Open it →
One-Time Pad
A fresh random shift for every letter, used once and destroyed. Unbreakable, and almost unusable.
Open it →
Simple Substitution
Any letter for any letter, with no pattern at all. The strongest one-letter cipher there is, and the hardest to remember.
Open it →
Trithemius
Shift by one more letter every time. No key word, and no letter ever looks the same twice.
Open it →
Binary
On or off, eight times over, and that is a letter. Everything you have ever typed is this underneath.
Open it →
Tap Code
The Polybius square sent by knocking on a wall. Nothing to write, and it goes straight through.
Open it →
ADFGX
A square and a transposition stacked together, with five letters chosen because they sound nothing alike in morse.
Open it →
Four-Square
Four grids at once, and pairs of letters read across them. Playfair without the awkward X.
Open it →
Bifid
Cut every letter into two numbers, mix the numbers with the neighbours, then put them back together.
Open it →
Homophonic Substitution
Common letters get several symbols each, so counting them tells a code-breaker nothing.
Open it →
Code Words
One agreed word standing for a whole sentence. Nothing is scrambled, and there is nothing to break.
Open it →
Nomenclator
Half cipher, half codebook. Important words vanish entirely, and the rest is enciphered letter by letter.
Open it →

Every cipher, sorted by how it works

This is our list. For a longer one, with an article on each, Wikipedia keeps a category of every classical cipher, and Practical Cryptography explains each with worked examples.

The full category Worked examples and code

Show all 46

Mechanical

Cipher disksTwo rings of letters and a pin through the middle
Rotor machinesWheels that step after every letter, so nothing ever repeats

Modern cryptography

One-time padRandom shifts, used once, and provably unbreakable The DIANA tableThe one-time pad as US Special Forces actually used it
XORThe same operation hides a message and reveals it
AESWhat actually protects your messages today
RSATwo keys: one you hand out, one you never show anyone
Diffie-HellmanTwo people agree a secret while everyone is listening
HashingA fingerprint for a message, easy forwards, impossible back
Digital signaturesProof of who sent it, which no cipher gives you

Hidden in plain sight

Some messages are hidden by scrambling them. Others are hidden by looking completely ordinary.

Read more elsewhere

Longer, harder and written for grown-ups. Worth a look when this page runs out.

Every classical cipher Worked examples and code