Vigenère Cipher Encoder/Decoder (Keyword Cipher)

Encode and decode messages with the Vigenère cipher entirely in your browser, using a keyword to shift each letter by a different amount. Encrypt and decrypt with the same keyword and inspect the transformation letter by letter. All processing happens locally in your browser.


Tips

  • The Vigenère cipher was once called "le chiffre indéchiffrable" (the indecipherable cipher), resisting practical cryptanalysis for roughly 300 years.
  • Because the keyword repeats, a shorter keyword means the same shift pattern repeats sooner, giving cryptanalysts more clues. Longer keywords are generally more secure.
  • Spaces, punctuation, and digits pass through unchanged without consuming a keyword position, so adding line breaks or spaces doesn't change the underlying encryption pattern.
  • Encryption and decryption are symmetric operations that use the same keyword. Use the "Reuse result as input" button to immediately try decrypting what you just encrypted.
  • The case of each letter (upper/lower) is preserved in the output exactly as typed, even though the shift calculation itself works on alphabet positions internally.

Frequently Asked Questions

In 1863, Prussian army officer Friedrich Kasiski published the "Kasiski examination," a method that estimates the keyword length from the distances between repeated substrings in the ciphertext, enabling systematic cryptanalysis for the first time. When part of the plaintext is already known, a known-plaintext attack can also recover the keyword.

The Caesar cipher applies a single fixed shift to the entire message, while the Vigenère cipher uses the numeric value of each keyword letter to apply a different, repeating shift to every letter. This defeats simple frequency analysis, which is exactly what breaks the Caesar cipher so easily.

It has long been credited to the French diplomat Blaise de Vigenère, but the same core method was actually published earlier, in 1553, by the Italian cryptologist Giovan Battista Bellaso. Vigenère himself is now believed to have devised a different, related cipher that only later became associated with his name.

It looks for identical substrings that repeat within the ciphertext and takes the greatest common divisor of the distances between them to estimate the keyword length. Once the length is known, each keyword position can be attacked separately with ordinary frequency analysis, effectively reducing the problem to several simple Caesar ciphers.

No, any string of letters works regardless of meaning. In practice, though, real words were often chosen for memorability, and that very predictability sometimes gave cryptanalysts, including those using the Kasiski examination, an extra edge.
ツールくん

Side Note — How the Kasiski Examination Broke an "Unbreakable" Cipher

The Vigenère cipher bears the name of the 16th-century French diplomat Blaise de Vigenère, but he probably wasn't its true inventor. In 1553, the Italian cryptologist Giovan Battista Bellaso had already published essentially the same method of shifting each letter by an amount determined by a repeating keyword. Vigenère himself later became associated with a different cipher through his 16th-century writings, and the misattribution only solidified in the 19th century — a classic case of credit going to the wrong person in the history of science.

Where the Caesar cipher uses one single fixed shift, and the mechanical Enigma machine changes its shift with every rotor step, the Vigenère cipher achieves a different shift for every letter by cycling through an easy-to-remember keyword. A message encrypted with a single Caesar shift falls quickly to basic frequency analysis, but the Vigenère cipher flattens the apparent letter-frequency distribution, which is why it was known as "le chiffre indéchiffrable" (the indecipherable cipher) and remained in practical use well into the mid-19th century.

That reputation ended when Prussian army officer Friedrich Kasiski published his "Kasiski examination" in 1863. By measuring the distances between repeated substrings in a ciphertext, he showed how to estimate the keyword length; once the length is known, each position can be attacked with the same frequency analysis used against a simple Caesar cipher. This turned roughly three centuries of practical security into a systematically breakable scheme, marking a genuine turning point in the history of cryptanalysis.

Interestingly, if the keyword were as long as the plaintext itself and used only once, the Vigenère cipher would be mathematically equivalent to the theoretically unbreakable "one-time pad." The real-world weakness came from reusing short keywords, a lesson about key management that still shapes modern cryptographic design today.