Vigenère Cipher Decoder

: Encode and decode the Vigenère cipher with a keyword, Beaufort and Autokey too, or crack a message whose key is unknown: every key length tried, the best key found and the text decoded
Limits: .txt
Cipher text
Letters A to Z; spaces, digits and accents in the key are skipped.
Vigenère adds the key letter; Beaufort subtracts; Autokey follows the key with the message.
Options
The result appears here as you type.

Encode a message with the Vigenère cipher, decode one when you know the keyword, or crack it when you do not: the page tries every key length, finds the most likely key and decodes the text with it. The Beaufort and Autokey variants are here too. Use it as a Vigenère cipher decoder for puzzles, escape rooms, geocaches, CTFs and homework; it runs in your browser.

  1. Type or paste into Text, or load a .txt file. The Examples give a message, a cipher text made with the key LEMON and a longer cipher text to crack.
  2. Pick the Direction: Encode encrypts with the key, Decode decrypts with a key you know, and Crack (unknown key) works the key out from the text.
  3. Type the Key, a word such as LEMON. Only its letters A to Z count; spaces and digits in it are skipped.
  4. Choose the Cipher: Vigenère (the usual one), Beaufort or Autokey. Read the result with the plain text, key and cipher letters lined up under it, and the rows of the Vigenère square your key uses. Swap turns the result into the input and flips Encode and Decode.
  5. Cracking: set Longest key to try (20 by default, up to 60). The best guess is shown in full, and a table gives the best key for every length, with its index of coincidence and the start of its text.

The key LEMON repeats under the message (LEMONLEMONLE), and each letter moves on by its key letter: A + L = L, T + E = X. Decoding with LEMON gives back: Attack at dawn!

Input
Attack at dawn!
Output
Lxfopv ef rnhr!

How do I decode a Vigenère cipher without the key?

Choose Crack (unknown key) and paste the text. Each key length is tried, the key letters are found from English letter frequencies and common words, and the best key's text is shown in full. The longer the text, the surer the result.

How does the Vigenère cipher work?

Write the key under the message, repeating it, and shift each letter by its key letter (A = 0, B = 1 … Z = 25). With the key LEMON, ATTACKATDAWN becomes LXFOPVEFRNHR.

What is the difference between the Caesar and Vigenère ciphers?

The Caesar cipher shifts every letter by the same amount. Vigenère uses a keyword, so the shift changes from letter to letter, which hides the letter frequencies that give a Caesar cipher away. A one-letter Vigenère key is a Caesar cipher.

Is the Vigenère cipher secure?

No. Charles Babbage and Friedrich Kasiski broke it in the 19th century, and this page cracks a few lines of English in a moment. Use it for puzzles and teaching; protect real data with a modern cipher such as AES.

Does the key skip spaces and punctuation?

Yes. The key moves on one letter for each letter A to Z of the message only, the usual convention; spaces, digits and punctuation pass through unchanged.

Runs entirely in your browser. Nothing is uploaded.