How to break the Vigenère cipher with knowledge of the key length

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

The Vigenère cipher was considered an unbreakable cipher in its day, so much was it believed. Time has shown, of course, that this was a very exaggerated claim. Nowadays, even the Vigenère cipher is one of the absolute easiest ciphers to crack, at least unless you use some long key along with a short text.

Attack with knowledge of the key length

The Vigenère cipher is very weak the moment we know the length of the key. For example, how would the encryption of the text "dobryvecer" work if we used an arbitrary key of length two? For the sake of example, we will assume that we used the key "oj":

Open text:dobryvecer
Key:ojojojojoj
Ciphertext:rxpameslsa

Due to the constant repetition of the "oj" key, every second letter of the plaintext is encrypted with the "o" key (highlighted in red) and the remaining letters are encrypted with the "j" key (highlighted in blue).

In doing so, the red text "dbyee" is encrypted to the text "rpmss" using the Caesar cipher with the key "o" and the same for the blue text, except we use the key "j".

Once we know the length of the key, we can split the ciphertext into individual blocks of text, which are always encrypted with a Caesar cipher with the same key. For example, if we find that the key is of length 3, we split the ciphertext into 3 blocks of text. The first block will contain the 1st, 4th, 7th, ... letter of the plaintext, the second block will contain the 2nd, 5th, 8th, ... letter, etc. We will break each block with the Caesar cipher and finally combine all these keys into one word to obtain the search key of the Vigenère cipher.

The following tool allows you to break the text encrypted by the Vigenère cipher if you give it the length of the key. It also lists all the blocks of text into which the ciphertext was split during the breaking process.

Ciphertext:
Key length: