Loading...
Loading...
Cryptography · Axiom Academy
Breaking the Vigenere cipher by finding repeated sequences and calculating key length 1. Why Repeated Sequences Occur The Vigenere cipher uses a repeating key to encrypt plaintext. When the same plaintext sequence aligns with the same key sequence, identical ciphertext appears. For plaintext letter p and key letter k : All arithmetic is modulo 26 (using A=0, B=1, ..., Z=25) Example: Consider the plaintext "CRYPTO" encrypted with key "KEY" (repeating as "KEYKEY"): 2. Finding Repeated Sequences and Distances The Kasiski method involves scanning the ciphertext for repeated sequences (typically trigrams or longer) and measuring the distance between repetitions. Notice the repetition of "VHVS" appearing 4 times. Let's find the distances: 3. Using GCD to Find Key Length Repeated sequences occur at intervals that are multiples of the key length . To find the probable key length, we calculate the Greatest Common Divisor (GCD) of all distances. 4. Index of Coincidence Method An alternative (or complementary) approach uses the Index of Coincidence (IC) , a statistical measure that indicates how likely two randomly selected letters from a text are to be identical. where f i is the frequency of the i -th letter and N is the total number of letters. English text: IC ≈ 0.065-0.068 Random text: IC ≈ 0.038 (1/26) Vigenere ciphertext: IC depends on key length 5. Complete Cryptanalysis Example Let's break a Vigenere cipher step-by-step using the Kasiski method:
This is the written version of the interactive lesson above. See the full Cryptography course.