Member-only story
Kasiski Analysis Method For Vigenère Cipher Attack
Kasiski method hunts for repeated patterns for polyalphabetic substitution systems. This can be aided with CPA (Chosen Plaintext attack), i.e. attacker can `force` the mark to cipher a targeted data for them in order to help the attacker to expose the key.
In English, high frequency sub-word groups are: -th, -ing, -ed, -tion, -ion, -ation; in- , im-, un-, re-; -eek-, -oot-, -our-; of, in, at, to, with, are, is, and, that.
Lemma: If key length is n, system ciphers it with cyclic rotation, and if a particular word occurs k times in plaintext, the probability should be about k/n times of same alphabets. E.g. A word appear > n times would have to appear at least 2x using the same character in key to encode, hence, ciphered in the same way. E.g. say the word is of the same length, and it appears k (where k > n) times, hence, it will be k*n characters of the text. The alignment happens when is k mod n = 0. With other text, say that the total length of text is T, dispersing the possible aligned text, it would be (T-kn) mod n = 0 to aid the possible the alignment.
Using chosen cipher text, we can designate repeated fragments of a certain length to check the key length. Since, we know where they are repeated, we check if they are repeated at the same place. Here, we check “it was the”.
"""
eg. key = ‘dickens’
message = ‘It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief…