CRYPTO

One-time pad

A Vigenère cipher whose key is random, as long as the message, and never used again. Nothing about the ciphertext says anything about the message except its length, so it can't be broken. The catch is getting a fresh pad to the other person for every message.

Direction

Result

Why it can't be broken

Someone intercepts this ciphertext, encrypted from ATTACK AT DAWN:

For any other message with the same number of letters, some pad turns this ciphertext into that message. Every message of this length is equally possible, so trying keys gets an attacker nowhere.

The pad that gives it

Use it twice and it breaks

These two messages were encrypted with the same pad:

Message 1
Message 2

Subtract one from the other and the pad cancels out, leaving the difference between the two plaintexts. That difference still carries the structure of English. Guess a word that might appear in one message, a crib, and slide it along. At each position the tool shows what the other message would have to say there. Where the result looks like English, you've probably found a real match. Choose it to lock both fragments in, then guess again from what you can read.

The word is in

Try THE, AT, AND, or words you'd expect in a spy's message.

    What you've recovered

    Message 1
    Message 2

    History

    Frank Miller, a California banker, described a one-time pad for telegraph codes in 1882. In 1917 Gilbert Vernam at AT&T built one into a teleprinter, combining each character with a character from a punched key tape, and Joseph Mauborgne of the US Army Signal Corps saw that the key had to be random and never reused. In 1949 Claude Shannon proved that a pad used this way gives perfect secrecy.

    The Soviet Union used one-time pads for diplomatic and intelligence traffic. Under wartime pressure in 1942, its pad makers printed some pages twice. The US Army's Venona project, started in 1943, found messages enciphered with the same pages and used them to read parts of about 3,000 messages, exposing Soviet agents in the Manhattan Project and the US government.

    The pads on this page come from your browser's cryptographic random number generator. That's fine for experimenting, but copying a pad through a clipboard and a web page isn't a safe way to handle real secrets.