TTKTheTextKit

Vigenere Cipher

Type or paste your text and a keyword to encrypt or decrypt it with a Vigenere cipher, or choose the crack mode to recover the key from English ciphertext. Only the letters A to Z are changed, the case of each letter is kept, and spaces, digits and punctuation stay where they are. The cracker shows the key it found, the key length and the index of coincidence for each length it tried. Everything runs in your browser.

Result
Lxfopv ef rnhr!

In a Vigenere cipher each letter is shifted by the matching letter of a repeating key, with A as 0 and Z as 25, so the key LEMON turns ATTACKATDAWN into LXFOPVEFRNHR. Only the letters A to Z are changed, the key moves forward only on letters, and the case of each letter is kept. The cracker estimates the key length from the index of coincidence and then finds each key letter from English letter frequencies, so it needs English text of a few hundred letters. This cipher is a puzzle from the 1500s and is not secure. Do not use it to protect real secrets. Everything is worked out in your browser.

Related Tools

[5 suggestions]

About the Vigenere Cipher

The Vigenere cipher shifts each letter by an amount taken from a repeating keyword. With A as 0 and Z as 25, the key LEMON shifts the first letter by 11, the second by 4, the third by 12, and so on, then starts again, so ATTACKATDAWN becomes LXFOPVEFRNHR. Because the shift changes from letter to letter, simple letter counts no longer reveal the message the way they do for a Caesar cipher. For about three centuries it was called the indecipherable cipher, until Friedrich Kasiski published a method for finding the key length in 1863. This tool uses a related idea. For each candidate key length it splits the text into columns made of every n-th letter and measures the index of coincidence, the chance that two letters drawn from a column are equal. English text scores about 0.066 and random letters about 0.038, so the right key length gives columns that look like English. Each column is then a Caesar cipher, and the best shift is the one that makes its letter counts fit English frequencies. The cracker needs English text and works best with a few hundred letters or more. The cipher is a historical puzzle and offers no real security, so do not use it to protect anything private.

How does the Vigenere cipher work?▾

Each letter of the message is shifted along the alphabet by the value of the matching letter of a repeating keyword. With the key LEMON, ATTACKATDAWN becomes LXFOPVEFRNHR.

How do I decrypt a Vigenere cipher with the key?▾

Shift each letter backwards by the matching key letter. Choose Decrypt, enter the ciphertext and the same keyword that was used to encrypt it.

Can a Vigenere cipher be broken without the key?▾

Yes, with enough English text. Find the key length with the index of coincidence or the Kasiski method, then solve each column as a Caesar cipher using letter frequencies. Short messages are much harder.

Is the Vigenere cipher secure?▾

No. It was a strong cipher in the 1500s, but modern methods break it in seconds. Use modern encryption for anything that matters.

Is my text uploaded?▾

No. Everything runs in your browser and nothing you type is sent anywhere.