Skip to content
CodeShift
Menu

Vigenère Cipher Explained

The Vigenère cipher uses a keyword to change the shift for each letter. HELLO encrypted with key KEY becomes RIJVS. Much harder to crack than Caesar.

By The CodeShift DeskPublished October 1, 2026

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:

  1. Find the corresponding key letter (cycle through the keyword)
  2. Add the two numbers mod 26
  3. 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.

Frequently asked questions

Who really invented the Vigenère cipher?+

The technique was first published by Giovan Battista Bellaso in 1553. Blaise de Vigenère described a related but different autokey system in 1586. The cipher bears Vigenère's name due to a misattribution by Kerckhoffs in 1883.

Why is the Vigenère cipher harder to crack than a Caesar cipher?+

A Caesar cipher uses one shift for every letter. A Vigenère cipher uses a different shift for each letter, determined by the keyword. This flattens the frequency distribution and breaks the simple pattern frequency analysis exploits.

How do you choose a good keyword for a Vigenère cipher?+

Longer keywords are harder to crack. A keyword as long as the message — used only once — becomes a one-time pad, theoretically unbreakable. Short, common words are weaker because repeated patterns reappear in the ciphertext.

Was the Vigenère cipher ever broken?+

Yes. Charles Babbage broke it around 1846 but did not publish his method. Friedrich Kasiski published a systematic breaking technique in 1863. William Friedman developed the index of coincidence method in 1922.

What is the Vigenère square?+

The Vigenère square (or tableau) is a 26×26 grid of the alphabet, each row shifted by one more position. To encrypt, find the plaintext letter in the column and the key letter in the row; the intersection is the ciphertext letter.

Keep reading