🔐 The Vigenère Cipher
The Vigenère Cipher is a polyalphabetic substitution cipher that uses
a keyword to encrypt text. It was considered unbreakable for over 300
years!
How It Works
Unlike the Caesar cipher which uses a single shift, the Vigenère
cipher uses a keyword where each letter determines a different shift:
- A = shift 0, B = shift 1, C = shift 2, ... Z = shift 25
- The keyword is repeated to match the length of the plaintext
-
Each plaintext letter is shifted by its corresponding keyword letter
Example
Plaintext: ATTACKATDAWN
Keyword: LEMON
Plaintext: A T T A C K A T D A W N Keyword: L E M O N L E M O N L E
Shifts: 11 4 12 14 13 11 4 12 14 13 11 4 Ciphertext: L X F O P V E F R
N H R
Result: LXFOPVEFRNHR
Encryption Formula
Ciphertext = (Plaintext + Key) mod 26 Example: A (0) + L (11) = L (11)
T (19) + E (4) = X (23)
How to Crack It
-
Find the Key Length: Use the Kasiski examination or
Index of Coincidence to find repeating patterns
-
Split into Groups: Once you know the key length,
split the ciphertext into groups
-
Frequency Analysis: Each group is essentially a
Caesar cipher - use frequency analysis on each
-
Combine: Put the individual Caesar shifts together
to find the keyword
Kasiski Examination
Look for repeated sequences in the ciphertext. The distance between
repetitions is likely a multiple of the key length.
Tips
- Longer keywords are harder to crack
-
If the keyword is as long as the message and random, it becomes a
One-Time Pad (unbreakable!)
- Common words like "THE" can help identify key length
- Online tools can help calculate the Index of Coincidence