Vigenère Cipher Decoder

Finds the key length through the index of coincidence and repeated fragments, then rebuilds the key from letter frequencies in the columns.

0 characters · 0 letters

Letter frequencies are taken for the chosen language: the key search depends on them.

Usually it is treated the same as е: an alphabet of 32 letters instead of 33.

How the key length is found

The key repeats across the whole text. If you arrange the ciphertext into columns spaced one key length apart, each column turns out to be encrypted with a single shift, and the letters in it are distributed as in ordinary text.

This distribution is measured by the index of coincidence: for connected English text it is about 0.065, for a random string of letters about 0.038.

A second clue comes from repetitions. Identical fragments of words that fall under the same stretch of the key produce identical fragments of ciphertext, and the distances between them are multiples of the key length. Friedrich Kasiski described this method in 1863.

How the key itself is recovered

Once the length is known, each column is compared against the letter frequencies of the language. The shift with the smallest discrepancy gives the next letter of the key, and together the letters form the whole word. The recovered key is shown next to the decryption, in full.

How much text is needed

Each column should get at least a few dozen characters. With a five-letter key that is about a hundred letters of text, with a ten-letter key about two hundred. On short strings the recovery is unreliable, and the page warns about this.

If you already know the key, you can decode the text directly in the Vigenère cipher encoder.

Rate this tool

Help us get better

Other tools