Autokey explained in plain terms means understanding the cipher that writes its own key as it goes, a design from 1586 in which the message itself becomes the keystream after a short primer. The central question is why a cipher would feed its own plaintext back into the key, and the answer is that a key that never repeats cannot be measured the way a repeating key can, so the classic attack on Vigenère simply has nothing to grab, and that trick is the whole point of the design.
Autokey is a polyalphabetic cipher described by Blaise de Vigenère in his 1586 book Traicté des chiffres, and it is the cleverer sibling of the Vigenère cipher that bears his name. It turns a message into ciphertext with a short primer followed by the plaintext itself, and it is built on the same addition table as Vigenère, which means the design changes only how the key is made, and that single change is what makes it far harder to break.
This article gives you five facts about Autokey, explains what it is, how it works, and why it still matters.
Key takeaways
- Autokey is a self-keying cipher from 1586.
- It was described by Blaise de Vigenère himself.
- Its keystream is the primer plus the plaintext.
- It defeats the Kasiski attack on repeating keys.
- It is used in teaching and in cipher history today.
What Autokey is
The first fact is that Autokey is a running-key cipher, not a repeating-key cipher. It starts with a short primer word and then continues with the plaintext itself, which means the keystream is as long as the message and never cycles, and because there is no period to find, the usual method for measuring a Vigenère key simply does not work.
The second fact is that it is Vigenère’s own invention. Blaise de Vigenère described Autokey in 1586 alongside the cipher that took his name, which means the design is older than most people realise, and because Vigenère himself preferred it, historians often call it the stronger of his two ciphers.
The third fact is that a ciphertext version exists too. In ciphertext Autokey the keystream continues with the ciphertext instead of the plaintext, which means an error corrupts only a few letters rather than the rest of the message, and because that self-healing property matters in noisy channels, the variant is the one engineers usually describe.
The fourth fact is that it is vulnerable to known plaintext. If an attacker guesses a word in the message, the keystream reveals itself letter by letter from that point on, which means a single correct guess can unravel the whole text, and because cribs are easy to guess in ordinary language, Autokey is a teaching cipher rather than a serious one.
The fifth fact is that it survived as a classic, not a curiosity. Autokey showed that the key itself could be part of the message, which means it is still the first example students meet when they learn about running keys, and that reputation is the reason it is taught beside the ciphers it was designed to improve.
Our guide to Vigenère explains the cipher Autokey improves on, and our guide to Atbash explains an older substitution cipher with a fixed key.
How Autokey works
Everything starts with the primer, a short word the sender and recipient agree in advance. Autokey writes the primer above the first letters of the message, which means only the opening of the keystream is secret, and because the primer is short, the whole security of the cipher rests on a handful of letters.
Each letter begins with the addition, which is done modulo 26 on the Vigenère table. The sender adds the keystream letter to the plaintext letter and wraps around the alphabet, which means every letter is enciphered exactly as Vigenère would do it, and because the table is the familiar one, anyone who knows Vigenère can use Autokey at once.
The keystream is what makes the design work as a whole. After the primer runs out, the plaintext itself feeds the key, which means the sender is always looking one step back at what they just wrote, and because the keystream follows the message, the cipher never repeats a key letter in a predictable rhythm.
The primer spreads the effect further. A longer primer delays the point where the plaintext starts feeding the key, which means the opening of the message is better protected than the rest, and because the primer is the only secret, choosing a long and random one is the best advice the cipher offers.
The decryption is what keeps the design usable. The recipient decrypts the first letters with the primer, then uses the recovered plaintext as the key for the letters that follow, which means decryption bootstraps itself from the primer onwards, and because each recovered letter unlocks the next, the whole message unfolds in order.
The ciphertext comes from the table, read out letter by letter in order. Autokey outputs one ciphertext letter per plaintext letter, which means the message keeps its length, and that fixed length is exactly what a classical cipher was expected to preserve.

Comparing Autokey with other classical ciphers
Autokey is one of several classical ciphers built on the Vigenère table, and each was built with a different emphasis. Vigenère is the famous cipher with a short repeating key, Beaufort is the reciprocal cipher that subtracts instead of adding, and Autokey is the one whose keystream is the message itself, while each approach trades something for something else.
The table below sets out the main contrasts between the leading approaches.
| Aspect | Autokey | Vigenère | Beaufort |
|---|---|---|---|
| Keystream | Primer plus plaintext | Repeating keyword | Repeating keyword |
| Period | None | Length of keyword | Length of keyword |
| Operation | Addition | Addition | Subtraction |
| Year | 1586 | 1586 | 19th century |
| Best for | Teaching running keys | General classical use | Teaching reciprocity |
The practical result is that Autokey is the right choice for teaching running keys, Vigenère suits general classical use, and Beaufort fits teaching reciprocity instead.
Where Autokey is used
Teaching uses it as the running-key example. Cryptography courses introduce Autokey when they explain that a key need not repeat, because it is the clearest case of a keystream built from the message, and a student who understands Autokey understands why key management matters more than the table.
Puzzle books use it to raise the difficulty. A puzzle that uses Autokey instead of Vigenère cannot be solved by finding the key length, because there is no key length to find, and that extra step is the reason puzzle setters reach for it when Vigenère feels too easy.
History uses it to tell the story of 1586. The year Vigenère published his book is one of the great dates in cryptography, and Autokey is remembered wherever that story is told, which means it survives as history as well as a working cipher.
Software libraries use it as a test case. A library that implements classical ciphers usually includes Autokey beside Vigenère, because the two share a table and differ only in the keystream, and that pairing is the reason the cipher still appears in modern code.
Amateur cryptographers use it for fun. Hobbyists who enjoy hand ciphers pick Autokey when they want a Vigenère that resists the standard attack, because the self-keying trick feels clever, and that cleverness is the reason it still appears in cipher challenges.
Strengths and limits
The greatest strength of Autokey is its keystream. A key that never repeats defeats the Kasiski examination that breaks Vigenère, and that strength is real, measured in the centuries of respect the cipher has enjoyed and confirmed by the attackers who had to find new methods to break it.
It is also a strength that the design is built from familiar parts. The same table and the same addition as Vigenère mean anyone who knows the older cipher can use Autokey at once, and that simplicity is worth more than cleverness in a field where a cipher nobody can use by hand is a cipher nobody remembers.
The limits are real, though, and the biggest is the known-plaintext attack. A single guessed word reveals the keystream from that point on, which means Autokey falls to cribs, and a system that needs real security must use a modern cipher instead.
Autokey checklist
- Use Autokey for teaching and puzzles, never for real secrets.
- Remember the keystream is the primer plus the plaintext.
- Choose a long, random primer for the best protection.
- Compare it with Vigenère to see the running-key idea.
- Note there is no key period for Kasiski to measure.
- Guard against guessed words, which reveal the keystream.
- Try the ciphertext variant to see self-healing in action.
- Never rely on a self-keying cipher for anything important.
- Choose a modern cipher for any message that matters today.
Frequently asked questions
What is Autokey in simple terms?
It is a 1586 cipher that starts with a short primer and then uses the message itself as the key, so the keystream never repeats.
Who invented Autokey?
Blaise de Vigenère, who described it in his 1586 book Traicté des chiffres alongside the cipher that took his name.
How is Autokey different from Vigenère?
Both use the same table and addition, but Vigenère repeats a short keyword while Autokey continues the key with the plaintext itself, so it has no period.
Is Autokey still secure?
No, a guessed word in the message reveals the keystream from that point on, so it is only safe for teaching, puzzles and history.
Where is Autokey used?
In cryptography courses, in puzzle books, in cipher software libraries, and in the history of classical ciphers.
When should I use Autokey?
When you teach running keys, when you set a harder puzzle, or when you want Vigenère without the repeating key.
The bottom line
Autokey explained in one line is this: the cipher that writes its own key, a 1586 design that fed the message back into the keystream and defeated the classic attack on repeating keys.
It is proof that the key can be part of the message, and the reason it still matters is that every running-key cipher designed since has been judged partly by the lesson Autokey taught.
This article is general information about how Autokey works, not advice about choosing encryption for a particular device or system.







