Autokey cipher
The autokey cipher shifts each letter like the Vigenère cipher, but instead of repeating a short keyword, the message itself becomes the key after a short starter, the primer.
A little history
This is the cipher Blaise de Vigenère actually described in his 1586 book on ciphers. The Italian scholar Girolamo Cardano had suggested using the message as its own key a few decades earlier, but his version was flawed. Vigenère fixed it with a primer: a short secret start to the key. Ironically, the cipher that now carries Vigenère's name, with its repeating keyword, was described earlier by Giovan Battista Bellaso.
How it works
- Choose a primer, for example
KO. - Build the key: the primer followed by the message itself, as long as the message.
- Shift each message letter by its key letter (A = 0, B = 1 … Z = 25).
| Message | S | P | I | E | S |
|---|---|---|---|---|---|
| Key | K | O | S | P | I |
| Cipher | C | D | A | T | A |
SPIESKOSPICDATAS + K = C, P + O = D, then the message takes over: I + S = A, E + P = T, S + I = A.
To decrypt, you start with the primer: it reveals the first letters, which then serve as the key for the next ones, and so on down the chain.
How to crack it
Autokey avoids the Vigenère cipher's biggest weakness: there's no repeating keyword, so the patterns Kasiski and Babbage used don't appear. But the key is made of ordinary English text, and that is its undoing. A codebreaker guesses a common word somewhere in the message, works out what part of the key that implies, and checks whether that key also reads as English. Short primers can simply be tried one by one.
Autokey in Cyrune
Cyrune uses a two-letter primer. The first primer letter unlocks letters 1, 3 and 5 in a chain; the second unlocks 2 and 4. A wrong primer letter garbles everything after it in its chain, so a decode that starts well and then falls apart means you're close. A green tile confirms a chain.
Related ciphers
- Vigenère cipher ★★★☆☆
- Running key ★★★★★
- Beaufort cipher ★★★★☆