Estimating the key length of the Vigenère cipher

Kapitoly: The Vigenère cipher, How to break the Vigenère cipher with knowledge of the key length, Estimating the key length of the Vigenère cipher, How to calculate the key length of the Vigenère cipher, Friedman test - coincidence index

Estimating the length of a key

We already know that if we know the length of the key, it is relatively easy to crack the Vigenère cipher. But how do we find this key length? One of the most sophisticated ways is to guess.

Seriously, it works.

We simply guess what the length of the key might be and try to decrypt the text. If that doesn't work and the decrypted text doesn't make sense, we just try the next length. The actual breaking of the cipher itself, once we know the length, is relatively fast, so we can try many different lengths in a very short time.

This gives us a simple algorithm: we try to break the ciphertext for key lengths 2, 3, 4, ... up to some limit, and among these broken texts we find the one that makes the most sense.

Online tool to break the Vigenère cipher

An implementation of this procedure is found in the following tool. The longer the ciphertext, the higher the probability of successful cracking. A few paragraphs of text should be sufficient, but this depends on the length of the key.

Ciphertext:
Maximum key length: