Vigenère Cipher

Encode and decode Vigenère, autokey and Beaufort ciphers, with key-length analysis for breaking one.

The Vigenère Cipher runs entirely in your browser. Your text and key are processed on your device and never uploaded.

Try the Caesar cipher

About Vigenère Cipher

Vigenère repeats a keyword across a message and shifts each letter by its matching key letter, which gives one plaintext letter many possible ciphertext letters and defeats the frequency analysis that breaks a plain Caesar shift. It held up for three centuries and was called le chiffre indéchiffrable for most of them. This tool runs it in both directions, keeps case and punctuation intact, and offers the two variants that come up most often: autokey, which extends the key with the plaintext so it never repeats, and Beaufort, which subtracts instead of adding and so is its own inverse. For a ciphertext with no key, index-of-coincidence analysis suggests likely key lengths.

Features

How to use the Vigenère Cipher

  1. Paste the text and enter a keyword
  2. Pick encode or decode, and a variant if you need one
  3. Read the result, with the keystream shown beneath it
  4. For an unknown key, switch to decode and check the suggested key lengths

Example

Input

ATTACKATDAWN with the key LEMON

Output

LXFOPVEFRNHR

The textbook example: each letter shifted by the key letter repeating above it.

Common errors & troubleshooting

Frequently asked questions

How does the Vigenère cipher work?
The keyword is repeated along the message, and each letter is shifted forward by the alphabet position of the key letter above it. A key letter of B shifts by one, C by two, and so on, wrapping at Z.
Can a Vigenère cipher be broken without the key?
Yes. Once the key length is known — from repeated patterns or from index of coincidence — the ciphertext splits into columns, each of which is a plain Caesar shift open to frequency analysis. Kasiski published the method in 1863.
What is the index of coincidence used for here?
It measures how often two letters picked at random from the text match. English sits near 0.067 and random text near 0.038, so the candidate key length whose columns score highest is very likely the real one.
How is the autokey variant different?
Instead of repeating the keyword, it continues the key with the plaintext itself. The key never repeats, which removes the periodic structure that Kasiski examination relies on and makes the cipher considerably harder.
Is the Vigenère cipher secure today?
Not at all. It falls to a few lines of analysis and is a puzzle or a teaching example, not protection. Anything that has to stay private needs modern authenticated encryption such as AES-GCM.

Related tools

All ArrayKit tools