How the Running Key cipher works
A running key cipher is a Vigenère cipher whose key is a long passage of text instead of a short repeating word. Because the key is as long as the message, there is no repetition for a codebreaker to measure.
- Pick a passage both sides have, such as the first page of a novel. Only its letters are used.
- Write the passage's letters under the message, one per letter. Spaces and punctuation in the message are kept and don't use up key letters.
- Shift each message letter by its key letter (A = 0, B = 1 … Z = 25). To decrypt, shift back.
The tool shows a warning if the key passage is shorter than the message. It still works, but the key repeats, and a repeating key is exactly what Vigenère-breaking tools look for.
Example
Using the opening of A Tale of Two Cities as the key, ATTACK AT DAWN becomes IMPAUD HX EEOG. The key letters under the message are ITWASTHEBEST.
How to break it
- Drag a probable word. Subtract a common word such as THE or AND from the ciphertext at every position. Where it gives English-looking key letters, both guesses are probably right. Extend from there in both directions.
- Both sides are English. Frequent pairs of plain and key letters (E with T, E with E, T with A …) are far more likely than rare ones, so a computer can score every possible split.
- Find the book. Once a stretch of key is recovered, searching for it often finds the source text, and then the whole message falls.
History
Running keys taken from books were used from the 1800s into the 20th century. During the First World War, American cryptanalysts including William Friedman published methods for breaking them with probable words, which showed that a key made of language is never as safe as a random one.
Related tools
- Vigenère cipher: the short repeating-key version
- Autokey cipher: the message itself as the key
- XOR cipher: the computer version of adding a key