Incoming message · Decrypt

Every secret has a key. Every key has a story.

From Sparta to Bletchley Park, from digital signatures to encrypted messages on your phone: how cryptography works, who invented it and why good cryptography holds even when the enemy knows the method.

Start with the history Topic index

The Caesar wheel: click or scroll to change the key

ABCDEFGHIJKLMNOPQRSTUVWXYZMABCDEFGHIJKLMNOPQRSTUVWXYZZABCDEFGHIJKLMNOPQRSTUVWXYZRQWERTZUIOASDFGHJKPYXCVBNML

Every time we open a website with a padlock, sign a digital document, pay with a smartphone or send a message on an encrypted app, we use cryptography: mathematics that turns readable text into something incomprehensible to anyone without the right key.

It is one of the oldest and most modern sciences at once. The Spartans wound leather strips around a staff, Julius Caesar shifted the letters of the alphabet, German engineers built rotor machines convinced they were unbreakable — and the mathematicians of Bletchley Park proved otherwise. Today algorithms protect billions of communications every second, and are already preparing for quantum computers.

On Key & Cipher every topic tells the history, the mechanism with a worked example, the essential mathematics, the weak points, today’s use and an exercise to try with pen and paper.

All topics

The laboratory’s ciphers

History of ciphers

Caesar cipher

The most famous cipher of antiquity: how the three-letter shift works, why it breaks in seconds and what it still teaches today.

9 pages
History of ciphers

The Spartan scytale

What the Spartan scytale was, how transposition ciphers work, what the ancient sources really say, how it is broken and what remains of it in modern cryptography. With examples and exercises.

9 pages
History of ciphers

Vigenère cipher

How the Vigenère cipher works — actually devised by the Italian Giovan Battista Bellaso: the table, the keyword, a step-by-step example, the maths, the Kasiski method that broke it and an exercise.

9 pages
History of ciphers

Enigma

How Enigma, the German cipher machine of the Second World War, worked, why it was believed unbreakable and how Polish and British mathematicians managed to read its messages.

9 pages
Principles

Symmetric encryption

How symmetric encryption works, the difference between block and stream ciphers, the key distribution problem, the maths of XOR, attacks and the algorithms used today.

9 pages
Principles

Public-key cryptography

The idea of public-key cryptography explained clearly: public and private keys, one-way functions, digital signatures, certificates, the secret British history, attacks and today’s uses.

9 pages
Principles

Cryptographic hash functions

What cryptographic hash functions are, the properties they must have, the birthday paradox, the history from MD5 to SHA-3, known attacks and today’s uses, from signatures to blockchain.

9 pages
Algorithms

AES

How AES, the symmetric encryption standard born of the NIST competition, works: blocks, keys, rounds, modes of operation, an official example, known attacks and mistakes to avoid.

9 pages
Algorithms

RSA

How RSA, the algorithm of Rivest, Shamir and Adleman, works: public and private keys, the mathematics of prime numbers, an example with small numbers, known attacks and use today.

9 pages
↑