The Vigenère cipher encrypts each letter using a different Caesar shift determined by a repeating keyword. Plaintext letter H plus key letter K (shift 10) gives R; E plus E (shift 4) gives I; and so on. HELLO with key KEY becomes RIJVS. With a longer keyword, the cipher resists simple frequency analysis — the same plaintext letter encrypts differently each time the key cycles.
How It Works
Assign each letter a number: A=0, B=1, … Z=25. For each plaintext letter:
- Find the corresponding key letter (cycle through the keyword)
- Add the two numbers mod 26
- Convert back to a letter
Encryption formula: ciphertext = (plaintext + key) mod 26 Decryption formula: plaintext = (ciphertext - key + 26) mod 26
Worked Example: HELLO with Key KEY
| Position | Plaintext | Key | Plain # | Key # | Sum mod 26 | Ciphertext |
|---|---|---|---|---|---|---|
| 1 | H | K | 7 | 10 | 17 | R |
| 2 | E | E | 4 | 4 | 8 | I |
| 3 | L | Y | 11 | 24 | 9 | J |
| 4 | L | K | 11 | 10 | 21 | V |
| 5 | O | E | 14 | 4 | 18 | S |
HELLO + KEY = RIJVS
To decrypt RIJVS with key KEY: R(17) − K(10) = 7 = H; I(8) − E(4) = 4 = E; J(9) − Y(24) + 26 = 11 = L; V(21) − K(10) = 11 = L; S(18) − E(4) = 14 = O. Back to HELLO. ✓
Use the Vigenère cipher tool to encrypt or decrypt with any keyword.
The Vigenère Square (Tableau)
The traditional method uses a table rather than arithmetic. Rows are labeled with key letters (A–Z) and columns with plaintext letters. To encrypt H with key K, find row K and column H — the cell contains R.
| Key \ Plain | A | B | C | D | E | F | G | H | I |
|---|---|---|---|---|---|---|---|---|---|
| A | A | B | C | D | E | F | G | H | I |
| B | B | C | D | E | F | G | H | I | J |
| E | E | F | G | H | I | J | K | L | M |
| K | K | L | M | N | O | P | Q | R | S |
| Y | Y | Z | A | B | C | D | E | F | G |
Row K, column H → R ✓
History and Attribution
The cipher commonly called the “Vigenère cipher” was actually published in 1553 by the Italian cryptographer Giovan Battista Bellaso, according to academic scholarship including Bonavoglia (2020, Trithemius, Bellaso, Vigenère: Origins of the Polyalphabetic Ciphers). Blaise de Vigenère (1523–1596) published his Traicté des Chiffres in 1586, describing a related but different autokey cipher. The misattribution of Bellaso’s work to Vigenère stems from Auguste Kerckhoffs’ 1883 cryptography treatise, as documented by researcher Satoshi Tomokiyo.
The cipher was called “le chiffre indéchiffrable” (the indecipherable cipher) for nearly three centuries. Charles Babbage broke it around 1846 but did not publish his work. Friedrich Kasiski published a systematic method in 1863. His key insight: if the same plaintext segment aligns with the same section of the repeating key, the same ciphertext segment repeats. The distance between repetitions is a multiple of the key length.
Strengths and Weaknesses
Stronger than Caesar because:
- The same plaintext letter can produce different ciphertext letters depending on key position
- Letter frequencies are spread across multiple alphabet shifts
- An attacker who knows the message starts with “the” cannot immediately determine the key
Still breakable because:
- Short keywords produce repeating patterns (Kasiski test finds the key length)
- Once the key length is known, each position reduces to a simple Caesar cipher that frequency analysis can break
- Only theoretically unbreakable when the key equals the message length and is used once (one-time pad)
See Caesar Cipher Explained for the simpler single-shift cipher, or How to Crack a Caesar Cipher for frequency analysis techniques that also apply to Vigenère once the key length is known.