Kasiski examination

[1][2] It was first published by Friedrich Kasiski in 1863,[3] but seems to have been independently discovered by Charles Babbage as early as 1846.

Thus finding more repeated strings narrows down the possible lengths of the keyword, since we can take the greatest common divisor of all the distances.

If we line up the plaintext with a 5-character keyword "beads" : The word "the" is sometimes mapped to "bea," sometimes to "sbe" and other times to "ead."

Therefore, the greatest common divisor of the distances between repeated sequences will reveal the key length or a multiple of it.

Then he took multiple copies of the message and laid them one-above-another, each one shifted left by the length of the key.

Modern attacks on polyalphabetic ciphers are essentially identical to that described above, with the one improvement of coincidence counting.