Vigenère Cipher Encoder / Decoder
Encrypt or decrypt text with a keyword using the Vigenère cipher.
About the Vigenère cipher
The Vigenère cipher is a polyalphabetic substitution cipher: instead of a single fixed shift, it repeats a keyword across the message and shifts each letter by the position of the matching key letter. With the key LEMON, ATTACKATDAWN encrypts to LXFOPVEFRNHR. For centuries it resisted casual code-breaking, earning the nickname le chiffre indéchiffrable. Only letters are enciphered — spaces, digits, and punctuation pass through, and the key only advances on letters.
For the simpler single-shift version, see the Caesar cipher or ROT13. All enciphering happens locally in your browser.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Working through a classical cipher exercise where a repeating keyword is the mechanism under study.
- Solving a puzzle whose ciphertext resists single-letter frequency analysis but has a short period.
- Demonstrating why a repeating key is the weakness rather than the strength of the scheme.
- Reproducing a historical message against a published keyword.
- Showing the contrast between a repeating key and a genuine one-time pad.
Frequently Asked Questions
- How does the cipher work?
- Each letter is shifted by the corresponding letter of a repeating keyword: with key CAT, the shifts are 2, 0, 19, 2, 0, 19… So the same plaintext letter encrypts differently depending on position, which is what defeats simple letter-frequency analysis.
- Why was it called "le chiffre indéchiffrable"?
- Because for roughly three centuries nobody published a general break. Described by Bellaso in 1553 and misattributed to Vigenère, it held until Babbage broke it privately in the 1850s and Kasiski published a method in 1863.
- How is it broken?
- First find the key length — repeated ciphertext sequences tend to be a multiple of it apart (Kasiski), or the index of coincidence reveals it. Then the message splits into that many simple Caesar ciphers, each of which falls to frequency analysis immediately.
- What makes a one-time pad different?
- The key is as long as the message, random, and never reused. That removes the repetition Vigenère depends on, and it is the only cipher with a proof of perfect secrecy. Reuse a one-time pad even once and it degrades straight back into this.
- Is it usable today?
- Only as a puzzle or a teaching example — a few hundred characters of ciphertext is enough to break it with software in seconds. It is genuinely valuable for understanding *why* modern ciphers avoid key repetition.
- What is a running-key variant?
- One where the key is a long text — a book passage — rather than a repeated word, removing the period that Kasiski examination exploits. It is stronger, but still breakable, because natural-language keys are themselves predictable.
Common errors and gotchas
- Reusing a short keyword on a long message, which is exactly what Kasiski examination and the index of coincidence exploit.
- Expecting non-letters to be enciphered. Punctuation and spaces usually pass through, and they leak the word boundaries.
- Treating it as unbreakable because of its historical nickname. It has been broken for well over a century.
- Losing the key. Without it the ciphertext is recoverable only by analysis, and that needs a decent quantity of text.
- Confusing it with a one-time pad, whose security depends on a key as long as the message and never reused.