applets.

Cipher Wheel

← All apps

About the Cipher Wheel

Write secret messages with three classic ciphers, then try breaking them. Turn the inner ring of the wheel to set the shift (drag it, use the arrow keys, the − and + buttons, or type a letter while the wheel is selected): each letter on the outer ring becomes the red letter under it. Type in the left-hand box and the other box follows as you type; ⇄ swaps them round to go the other way.

Crack it reads a message when you don't have the key. Secret link copies a link to your coded message, without the key, to send to a friend: they need the key, or the Crack it tab.

THE STORY

The Roman historian Suetonius wrote that Julius Caesar kept his private letters secret by moving every letter three places along the alphabet, so A became D. A shift of 13 is known as ROT13: doing it twice brings you back where you started, so the same step both hides and reveals.

Atbash is an old Hebrew cipher that turns the alphabet back to front: A becomes Z, B becomes Y. Its name is made from the Hebrew letters it swaps: aleph with tav, bet with shin.

In the 9th century the Arab scholar Al-Kindi wrote the first known description of frequency analysis. In any language some letters are far more common than others, so count the letters of a secret message and match its commonest ones to the language's commonest. A shift cipher can't hide that: the chart on this page shows English's pattern simply slid along.

Mary, Queen of Scots, wrote letters in cipher about the Babington Plot against Elizabeth I. Elizabeth's codebreaker Thomas Phelippes broke the cipher, and the letters led to Mary's execution in 1587.

The Vigenère cipher uses a keyword, and each letter of the key gives a different shift, so a common letter such as E is hidden behind several disguises. It is named after Blaise de Vigenère, but Giovan Battista Bellaso described it first, in 1553. It was called le chiffre indéchiffrable, the indecipherable cipher, until Charles Babbage broke it in the 1850s (he never published how) and Friedrich Kasiski published a method in 1863.

HOW THE CRACKING WORKS

Caesar: there are only 26 shifts (counting 0, which changes nothing), so the page tries them all. Each answer's letter counts are compared with ordinary English using a chi-squared score: add up (seen − expected)² ÷ expected over the 26 letters. The smallest score looks most like English. About 20 letters is usually enough.

Vigenère: first find the key length. Split the text into columns, every 5th letter say. If 5 is the key length, each column is a plain Caesar shift, so its index of coincidence (the chance that two letters picked from it match) is English-like, about 0.065; at a wrong length the letters are mixed and it falls towards 1⁄26, about 0.038. Kasiski's test is a second opinion, given in each length bar's label (the guess itself comes from the IoC): the same three letters repeated in the cipher text are often the same word met by the same part of the key, so the gaps between them tend to be multiples of the key length. The page tries key lengths up to 16 (fewer in a short text, so each column keeps at least six letters). Then each column is cracked like a Caesar. A few hundred letters works well; with less, some key letters may come out wrong, and the page says so. Click a key letter and turn the wheel to fix it by hand.

FURTHER WATCHING AND READING

Cipher text

LETTER FREQUENCY

TRY A MESSAGE