Autokey Cipher
The Autokey Cipher is a polyalphabetic substitution cipher that uses a priming key followed by the plaintext itself (or ciphertext) to generate the keystream. This addresses the periodicity weakness of the Vigenère cipher by making the key as long as the message.
What You'll Learn
Introduction to Autokey Cipher
The Autokey Cipher is a polyalphabetic substitution cipher that uses a priming key followed by the plaintext itself (or ciphertext) to generate the keystream. This addresses the periodicity weakness of the Vigenère cipher by making the key as long as the message.
Prerequisites
How to Solve Autokey Cipher Problems
Step 1: Start with the priming key (keyword) as the initial keystream
Step 2: For encoding, extend keystream with the plaintext itself
Step 3: Apply Vigenère addition: C = (P + K) mod 26
Step 4: For decoding, start with priming key, then use decoded plaintext to extend keystream
Step 5: P = (C - K) mod 26, then add P to keystream for next positions
Example Problem
Example: Encode 'HELLO' with priming key 'KEY' using autokey (plaintext feedback). Solution: Step 1: Priming key: K(10), E(4), Y(24) Step 2: Keystream: K E Y + plaintext: H E L L O (8,4,11,11,14) Step 3: Full keystream: 10,4,24,8,4,11,11,14 (for 8 letters? Actually message length 5, so keystream length 5? Wait, priming key length 3, so we need 2 more from plaintext: H(7) and E(4) -> total keystream: 10,4,24,7,4) Step 4: C = (P+K) mod 26: H(7)+10=17→R E(4)+4=8→I L(11)+24=35→35-26=9→J L(11)+7=18→S O(14)+4=18→S Step 5: Ciphertext: RIJSS Answer: RIJSS
Pro Tips & Tricks
- Two variants: plaintext autokey (uses plaintext for keystream) and ciphertext autokey
- Plaintext autokey is more common in competitive exams
- The keystream length equals the message length
- Priming key is the only shared secret between encoder and decoder
- Decoding requires knowing the priming key only; the rest is derived
- Autokey eliminates the periodic pattern of Vigenère
Shortcut Methods to Solve Faster
Common Mistakes to Avoid
Practice Worksheets
Practice makes perfect! Work through these worksheets to master Autokey Cipher. Each worksheet contains 20 questions with detailed explanations. Start from Worksheet 1 and progress through increasing difficulty levels.
Exam Importance
Autokey Cipher is an important topic for various competitive exams. Here's how frequently it appears:
Ready to Master Autokey Cipher?
Start with Worksheet 1 and work your way up to expert level! Each worksheet includes: