What Is the Vigenère Cipher?
The Vigenère cipher is a polyalphabetic substitution cipher that encrypts text by applying a different Caesar shift to each letter based on a repeating keyword. If the keyword is "KEY", the first letter shifts by 10 (K = 10), the second by 4 (E = 4), the third by 24 (Y = 24), then the pattern repeats. This means the same plaintext letter can encrypt to different ciphertext letters depending on its position — the defining feature that separates polyalphabetic ciphers from monoalphabetic ones like Caesar.
For over 300 years, from its invention in 1553 to its first published cryptanalysis in 1863, the Vigenère cipher was called "le chiffre indéchiffrable" — the indecipherable cipher. It defeated every known attack of its era by flattening the letter frequency distribution that makes single-alphabet ciphers trivially breakable. It was not until Friedrich Kasiski and independently Charles Babbage developed new statistical techniques that the cipher finally fell.
How the Vigenère Cipher Works
Encryption Formula
For each plaintext letter at position i, the encryption formula is:
Cᵢ = (Pᵢ + Kᵢ) mod 26
Where Pᵢ is the plaintext letter's position (A = 0, B = 1, … Z = 25), Kᵢ is the corresponding keyword letter's position, and mod 26 wraps the result within the alphabet.
Decryption Formula
Pᵢ = (Cᵢ − Kᵢ + 26) mod 26
Step-by-Step Example
Encrypt ATTACK AT DAWN with the keyword LEMON:
| Position | Plaintext | Key Letter | P + K | mod 26 | Ciphertext |
|---|---|---|---|---|---|
| 1 | A (0) | L (11) | 11 | 11 | L |
| 2 | T (19) | E (4) | 23 | 23 | X |
| 3 | T (19) | M (12) | 31 | 5 | F |
| 4 | A (0) | O (14) | 14 | 14 | O |
| 5 | C (2) | N (13) | 15 | 15 | P |
| 6 | K (10) | L (11) | 21 | 21 | V |
| 7 | A (0) | E (4) | 4 | 4 | E |
| 8 | T (19) | M (12) | 31 | 5 | F |
| 9 | D (3) | O (14) | 17 | 17 | R |
| 10 | A (0) | N (13) | 13 | 13 | N |
| 11 | W (22) | L (11) | 33 | 7 | H |
| 12 | N (13) | E (4) | 17 | 17 | R |
Result: ATTACK AT DAWN → LXFOPV EF RNHR
Notice that the two T's at positions 2 and 3 encrypt to different letters (X and F) because they align with different keyword letters (E and M). Similarly, the three A's at positions 1, 4, and 7 become L, O, and E respectively. This varying substitution is exactly what makes frequency analysis ineffective against polyalphabetic ciphers.
The Tabula Recta
The tabula recta (also called the Vigenère square or Vigenère table) is the 26×26 grid traditionally used to perform Vigenère encryption by hand. Each row represents a Caesar cipher with a different shift value — row A is shift 0, row B is shift 1, and so on.
To encrypt a letter using the tabula recta:
- Find the row corresponding to the keyword letter.
- Find the column corresponding to the plaintext letter.
- The letter at the intersection is the ciphertext letter.
The preview table on this page shows a 6×6 portion of the full grid. Explore the complete 26×26 tabula recta on our interactive Vigenère table page, where you can click any cell to see the encryption relationship.
How to Recognize Vigenère Ciphertext
Before attempting to break a cipher, it helps to identify whether you are dealing with Vigenère encryption. Several characteristics distinguish Vigenère ciphertext from other cipher types:
- Letters only, with preserved word boundaries. Like Caesar, Vigenère traditionally encrypts only alphabetic characters, leaving spaces and punctuation intact. Word lengths match the original plaintext.
- Flattened but not uniform letter frequencies. In a Caesar cipher, the frequency distribution looks like English but shifted. In Vigenère ciphertext, the distribution is significantly flatter — no single letter dominates — but it is not completely uniform either (which would suggest a one-time pad or random text).
- Index of Coincidence between 0.04 and 0.05. The IC of Vigenère ciphertext typically falls between the English value (~0.067) and the random value (~0.038), depending on key length. An IC in this intermediate range is a strong indicator of polyalphabetic substitution.
- Repeated sequences at regular intervals. If you spot identical 3+ letter sequences appearing at distances that share a common factor, the text is very likely Vigenère-encrypted (this is the basis of Kasiski analysis).
The Cipher Identifier tool on this site uses these characteristics to automatically detect Vigenère encryption and estimate the key length.
Where You'll Encounter the Vigenère Cipher
Despite being centuries old, the Vigenère cipher appears frequently in modern contexts:
- CTF competitions. Cybersecurity Capture The Flag challenges routinely use Vigenère encryption at intermediate difficulty levels. Competitors must identify the cipher type, determine the key length, and recover the key to obtain the flag.
- Escape rooms and puzzle hunts. Vigenère is a popular choice for multi-step puzzles because it requires both a key and ciphertext, allowing puzzle designers to hide the keyword as a separate clue.
- Cryptography courses. The Vigenère cipher is the standard example used to teach polyalphabetic substitution, key management, Kasiski analysis, and the Index of Coincidence in university-level cryptography and information security courses.
- Pop culture. The Vigenère cipher has appeared in the TV series Gravity Falls, the video game Destiny 2, and numerous detective novels. The animated show Gravity Falls famously used Vigenère-encrypted messages in its end credits, with the keyword hidden in each episode.
- Historical reenactment. Civil War enthusiasts and educational programs use replica Confederate cipher disks to demonstrate period-accurate encryption techniques.
Related Polyalphabetic Ciphers
The Vigenère cipher is part of a family of polyalphabetic systems that evolved from the same core idea:
- Beaufort Cipher — A reciprocal variant where the key letter is subtracted from a fixed position rather than added. Beaufort encryption and decryption use the same operation.
- Autokey Cipher — Vigenère's own invention: the key starts with a primer and then appends the plaintext itself, eliminating the repeating-key weakness.
- Gronsfeld Cipher — A Vigenère variant that restricts the key to digits (0–9), reducing the per-position keyspace from 26 to 10.
- Running Key Cipher — Uses a long passage of text (e.g., a book page) as the key, approaching one-time pad security without requiring a truly random key.
- Trithemius Cipher — The predecessor that shifts each letter progressively (A=0, B=1, C=2, …) without a secret key. Bellaso's innovation was replacing this fixed progression with a secret keyword.
- Porta Cipher — A reciprocal digraphic cipher using 13 alphabets, designed as a self-inverse system.
- Quagmire Cipher — A family of four variants that combine keyword-mixed alphabets with Vigenère-style polyalphabetic shifting.
- Alberti Cipher — The first polyalphabetic cipher, invented by Leon Battista Alberti in the 1460s using a rotating cipher disk. Alberti's concept of changing alphabets during encryption was the precursor to all subsequent polyalphabetic systems, including Bellaso's keyword method.
The evolution from Alberti's cipher disk (1460s) → Trithemius's progressive shift (1508) → Bellaso's keyword method (1553) → Vigenère's autokey system (1586) represents one of the most important development arcs in the history of cryptography, each step addressing a weakness of the previous design.
Further Reading
Explore Vigenère cipher history, cryptanalysis techniques, and code implementations:
- Breaking the Vigenère Cipher: Kasiski Examination & Index of Coincidence — Step-by-step guide to cracking Vigenère encryption without the key
- Caesar vs Vigenère Cipher: Complete Security Comparison — Understand the key differences between monoalphabetic and polyalphabetic substitution