# Kasiski test

This online calculator performs Kasiski examination of an entered text using trigrams in attempt to discover a key length

The polyalphabetic substitution ciphers were described around the 14th century (with the Vigenère cipher dated 1553 being the best-known example). It was a successful attempt to stand against frequency analysis. They were easy to understand and implement. They were considered unbreakable until 1863 when Friedrich Kasiski published his method of attacking polyalphabetic substitution ciphers, now known as **Kasiski examination** aka **Kasiski's test** or **Kasiski's method**.

This test aims to try to deduce the length of the keyword used in the cipher. To do this, cryptanalyst looks for repeated characters in text (trigrams or more) and measures the distance between them. If these repeated characters are not by coincidence, then they correspond to some characters repeated in the original text as well (i.e., "the"), and the distance between them is a multiply of the key length. The most frequent greatest common divisor of all occurrences is the most likely key length.

Having the possible key length, cryptanalyst then breaks ciphered text into columns, which correspond to series of simple substitution Caesar ciphers, and breaks them using frequency analysis to uncover the keyword.

The calculator below examines an entered text for repeated trigrams, then calculates the most probable length of a key. It displays the length and the percentage of found distances, which can be obtained by multiplying this key length. It also shows trigram statistics - repeated, how many times they were repeated, and where the first occurrence can be found.

Though it is worth to mention, that Kasiski's method was somewhat superseded by the attack using the Index of Coincidence (known as **Friedman test** or **kappa test**) developed in the 1920s, which is implemented in our Vigenère cipher breaker.

## Comments