Autokey Cipher

Encrypt and decrypt text with the Autokey cipher online. Enter a starting keyword, choose an alphabet or use auto detection, and see how the plaintext itself extends the key stream.

Input
0 chars · 0 bytes
Try:
Result
✓ Polyalphabetic substitution cipher ✓ Key stream continues with the message text ✓ We never store your messages ✓ Processed on our server
Examples
Encrypt ATTACK AT DAWN Key: QUEENLY
Input ATTACK AT DAWN
Output QNXEPV YT WTWP

Starting key: QUEENLY. After the initial key is consumed, the plaintext letters continue the key stream.

Decrypt QNXEPV YT WTWP Key: QUEENLY
Input QNXEPV YT WTWP
Output ATTACK AT DAWN

Starting key: QUEENLY. The same key and alphabet restore the original message.

Short Autokey example Key: KEY
Input HELLO
Output RIJSS

A compact example showing how the keyword seed is followed by plaintext letters.

Preserve spaces in a longer message Key: FORT
Input DEFEND THE EAST WALL
Output ISWXQH YLR HTZX AADE

Starting key: FORT. Spaces are preserved, while the alphabet letters are encrypted with the Autokey stream.

How the Autokey Cipher works

The Autokey Cipher is a polyalphabetic substitution cipher related to the Vigenere family. It begins with a starting keyword, but instead of repeating that keyword for the whole message, it continues the key stream with the message text itself.

For encryption, each plaintext letter is shifted by the current key-stream letter. After the initial keyword is used, the original plaintext letters become the following key letters. For decryption, the same keyword is required first; as each plaintext letter is recovered, it is added back into the key stream so the rest of the message can be decoded.

This makes Autokey different from a repeating-key Vigenere cipher: the key stream changes with the actual message, so repeated patterns are reduced, but the method is still a classical cipher and is not secure for modern private communication.

When to use this tool

Use this Autokey Cipher tool to encode and decode sample text, check homework or CTF examples, demonstrate how key streams work, and compare Autokey with Vigenere, Beaufort, Gronsfeld, and other classical polyalphabetic ciphers.

The service supports encryption and decryption, a custom starting key, automatic alphabet detection, and manual alphabet selection for English, Russian, Spanish, Portuguese, Turkish, French, German, and Italian text. Spaces, punctuation, numbers, and other non-alphabet characters are preserved, which makes the result easier to read and verify.

Autokey inputs and output

To encrypt a message, enter the plaintext, select Encrypt, and provide a starting keyword such as QUEENLY or FORT. The keyword should contain at least one letter from the selected alphabet; other characters are ignored for the key stream.

To decrypt, paste the ciphertext, select Decrypt, and use the exact same starting keyword and alphabet that were used during encryption. If the wrong key or alphabet is chosen, the tool will still produce text, but it will not restore the original message.

Autokey vs Vigenere

Both Autokey and Vigenere use a sequence of Caesar-style shifts, but they build the key stream differently. Vigenere repeats the keyword until the text is covered, while Autokey uses the keyword only as a starting seed and then appends plaintext letters.

This design reduces obvious repetition from a short keyword, but it also means decryption depends on correctly reconstructing the plaintext step by step. A single wrong key letter, alphabet mismatch, or transcription error can affect the following part of the decoded text.

FAQ

The Autokey Cipher is a classical polyalphabetic substitution cipher. It starts with an initial keyword, then extends the key stream with the message text itself instead of repeating the keyword.

No. Autokey is related to Vigenere, but Vigenere repeats the keyword, while Autokey uses the keyword only at the beginning and then continues with plaintext letters.

Yes. Decryption needs the same starting keyword and the same alphabet that were used for encryption. A different key or alphabet will produce a different decoded text.

Only letters from the selected alphabet are encrypted or decrypted. Spaces, punctuation marks, numbers, emoji, and other symbols are preserved in their original positions.

The tool can auto-detect the alphabet or use a manually selected alphabet for English, Russian, Spanish, Portuguese, Turkish, French, German, or Italian text.

No. Autokey is useful for learning classical cryptography, puzzle solving, and historical cipher demonstrations, but it is not suitable for protecting sensitive modern communication.

During decryption, each recovered plaintext letter becomes part of the following key stream. If the starting key, alphabet, or ciphertext is wrong, the error can influence later shifts.
Related tools

Caesar Cipher

Classic letter-shift cipher with custom shift values.

XOR Cipher

Online XOR encryption and decryption with text or hex keys.

Playfair Cipher

Classic digraph substitution cipher with keyword matrix encryption.