Vigenere Cipher Encoder & Decoder
The Vigenère Cipher (sometimes written as Vigenere without the accent) is a classic polyalphabetic substitution cipher that uses a repeating key to shift letters — essentially a set of Caesar ciphers chained together. It used to be called “le chiffre indéchiffrable” (the indecipherable cipher) before cryptanalysts figured out how to break it. Today it’s a brilliant step up from Caesar for learning about cryptography and a beloved favourite among puzzlers.
This page explains the Vigenère square, how to choose and use keys, practical examples, its historical background, basic attacks (Kasiski & frequency analysis), plus a set of puzzles for you to try. If you want to just encode or decode text, the tool is above — if you're here to learn, stay a while and read on.
What Is the Vigenère Cipher?
At its core, the Vigenère Cipher shifts each plaintext letter by the value of a corresponding letter in the key. The key repeats to match the length of the message. Where Caesar uses a single constant shift (e.g. +3), Vigenère uses a sequence of shifts determined by the key.
If your key is KEY (K=10, E=4, Y=24 when A=0), then the first plaintext letter is shifted by 10, the second by 4, the third by 24, then the key repeats.
The Vigenère Square (Tabula Recta)
The Vigenère square — sometimes called the tabula recta — is a 26×26 table of shifted alphabets. Each row is the alphabet shifted by the row letter’s position. You can imagine it as a quick lookup grid when encrypting or decrypting.
Key : K E Y K E Y ...
Plain: H E L L O W
Row K: (H->R) etc.
(You can include a rendered table or image in your template; the table is left out here to keep HTML compact. If you'd like, I can generate an accessible Vigenère table markup for your site.)
Encryption & Decryption — Step by Step
Encryption
- Choose a key (e.g.,
KEY). - Repeat the key to match message length (HELLO → KEYKE).
- For each plaintext letter, shift it by the alphabetical index of the matching key letter (A=0, B=1…).
- Lookup or calculate: Ciphertext letter = (Plain + Key) mod 26.
Decryption
- Use the same key as used for encryption.
- For each ciphertext letter, reverse the shift: Plain = (Cipher − Key) mod 26.
Example
Key: KEY (K=10, E=4, Y=24)
Plaintext: ATTACKATDAWN
Key (rep): KEYKEYKEYKEY
Ciphertext: KXRKGI KX BKAL
Working one letter: A (0) + K (10) = 10 → K
Full example (complete):
Plaintext: ATTACK AT DAWN
Key: KEYKEY KE YKEY
Ciphertext: KXRKGI KX BKAL
Step-by-Step Example
Let's encode "HELLO" with the keyword "KEY":
| Position | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Message | H | E | L | L | O |
| Keyword (repeating) | K | E | Y | K | E |
| Shift Amount | 10 | 4 | 24 | 10 | 4 |
| Result | R | I | J | V | S |
So "HELLO" encoded with keyword "KEY" becomes "RIJVS".
History & Why It Mattered
The Vigenère Cipher was described in the 16th century and later popularised in the 19th century. For many years it was considered extremely secure — earning the nickname “le chiffre indéchiffrable.” It was used for diplomatic and military communications for a long time, until cryptologists developed statistical methods to attack it.
Why It’s Stronger Than Caesar — And Why It Can Still Be Broken
- Stronger: Uses multiple shifts (determined by the key), so single-letter frequency analysis is less effective.
- Weaker: If the key is short or re-used across many messages, patterns emerge. Cryptanalysts exploit key length and repeating sequences.
Basic Attacks
Two classical ways to attack Vigenère:
- Kasiski Examination — look for repeated sequences of ciphertext and measure distances between repeats to guess key length.
- Friedman Test (Index of Coincidence) — statistical method to estimate likely key length by comparing letter distribution to expected language distribution.
Once the key length is known, you can divide the ciphertext into Caesar-shifted groups and run frequency analysis on each group.
Practical Tips for Using Vigenère (for Puzzles & Teaching)
- Use a long, non-repeating key for stronger obfuscation.
- Prefer a key phrase (e.g.,
BLACK_CAT_1933) and strip spaces/punctuation consistently. - For puzzle use, short keys are fine — they make solvable challenges.
- Consider autokey variants (key includes part of the plaintext) if you want more variety.
Vigenère Puzzles (Try These)
Puzzle 1 — Beginner
Ciphertext: RIJVS UYVJN
Key: KEY
Hint: Classic example often appears in crypto primers.
Puzzle 2 — Intermediate
Ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ
Key length likely small (2–6).
Hint: Try Kasiski to find repeats.
Puzzle 3 — Autokey Twist
Ciphertext: XKFGH YZQKM
Key: the first 3 letters of plaintext (autokey)
Hint: Autokey variants are trickier — try guessing the first few plaintext letters.
If you'd like, I can create a separate answers page (or a reveal-on-click solution) so you can link a “solutions” page without showing answers on the main page.
Use Cases Today
Vigenère is still used for puzzles, learning cryptography, and recreational encryption. It’s a great stepping stone to modern ciphers and introduces the idea of key management and polyalphabetic substitution.
Related Tools & Pages
Frequently Asked Questions
Is the Vigenère Cipher secure?
Not by modern standards. It can be strong if the key is long and random, but classical attacks (Kasiski, Friedman) break many common implementations.
How do I pick a good key?
Pick a long, unpredictable key. Phrase-based keys are okay for puzzles; for anything serious, use modern symmetric encryption instead.
What is the Vigenère square?
Also called the Tabula Recta — it’s the 26×26 table used to look up cipher letters for encryption and decryption.
What is the difference between Vigenère and Caesar?
Caesar uses a single fixed shift. Vigenère uses a sequence of shifts determined by a repeating key — essentially multiple Caesar ciphers applied in sequence.
Can repeated keys be detected?
Yes — repeated keys create patterns that the Kasiski method and Friedman Index can detect and exploit.