Guide
The Vigenère cipher: encrypting with a keyword, and breaking it
The Vigenère cipher encrypts with a keyword. Each letter of the message is shifted by the corresponding letter of the keyword, which repeats as often as needed. With the key LEMON, the first letter is shifted by L (11 places), the second by E (4), and so on, so the same plaintext letter becomes different cipher letters in different positions. For about 300 years it was called “le chiffre indéchiffrable”, the indecipherable cipher.
Encrypting and decrypting
Enter a keyword (letters only; other characters are ignored), choose Encrypt or Decrypt and type the text. Spaces, digits and punctuation pass through unchanged and do not use up key letters, which is the usual modern convention; capitals are preserved. For encryption you can output letters only or five-letter groups to hide word boundaries. The classic test, ATTACKATDAWN with key LEMON, gives LXFOPVEFRNHR.
Autokey, Beaufort and Variant Beaufort
Autokey Vigenère uses the keyword once and then continues with the plaintext itself, so the key never repeats. The Beaufort cipher subtracts the plaintext from the key instead of adding, which makes it its own inverse: encrypting twice gives the original. It was used in some cipher machines and the US Army’s M-209. Variant Beaufort subtracts the key, which is the same as Vigenère decryption.
How the cracker works
The weakness of Vigenère is the repeating key. If the key has five letters, every fifth letter of the message was shifted by the same amount, so each of those five “columns” is just a Caesar cipher. The cracker tries key lengths from 1 to 20. For each, it measures the index of coincidence of the columns, a statistic that is about 0.066 for English-like text and 0.038 for random letters, so the right length stands out. Then it breaks each column with frequency analysis, picking the shift whose letter distribution best matches English. The best keys are listed with their decryptions; press Use to load one into the cipher.
How much text is needed
Statistics need material. A rule of thumb is ten or more letters per key letter: a few hundred letters reliably reveal keys up to about ten letters. Below about 60 letters a warning appears, because guesses become unreliable. Multiples of the real key, such as LEMONLEMON, decrypt correctly too; the cracker prefers the shortest.
History
Giovan Battista Bellaso described the cipher in 1553; it was later misattributed to Blaise de Vigenère. Charles Babbage broke it in the 1850s but did not publish, and Friedrich Kasiski published a method in 1863. William Friedman’s index of coincidence (1920s) is the statistic used here.
A worked example
With the key LEMON, the first letter of ATTACK, A, is shifted by L (11 places) to L; the second, T, is shifted by E (4) to X; the third, T, by M (12) to F. Continuing gives LXFOPVEFRNHR for ATTACKATDAWN. In the cracker, a few paragraphs encrypted with the key DICKENS come back with DICKENS at the top, key length 7, because the columns for length 7 have an index of coincidence close to English.
Related tools
Start with single shifts in the Caesar Cipher Solver, try a digraph cipher with the Playfair Cipher, or modular arithmetic with the Affine Cipher.
Checked against the current version of the Vigenère Cipher on .

