Exercise 3: Key Length from the Kasiski Examination — Possible Solution ==================================================================== Per the chapter's explanation of the Kasiski examination, when the same repeated ciphertext fragment appears twice, the distance between the two occurrences must be a MULTIPLE of the key length (because the repeat only happens when the same plaintext fragment happens to align with the same part of the repeating keyword both times). QVX repeats at a distance of 24. Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24 MPZ repeats at a distance of 18. Factors of 18: 1, 2, 3, 6, 9, 18 The key length must be a factor common to BOTH distances, since a single, consistent key length has to explain every repeat found in the ciphertext, not just one of them. Common factors of 24 and 18: 1, 2, 3, 6 Excluding 1 (a key length of 1 is just a Caesar cipher, not a genuine Vigenère key, and wouldn't be worth a Kasiski examination in the first place), the supported key lengths are: 2, 3, or 6 Most likely candidate: 6, since real Vigenère keywords are rarely as short as 2 or 3 letters, and 6 is the largest common factor — the strongest, most specific piece of evidence the two repeats agree on together. WHY THIS WORKS AS AN ANSWER ------------------------------ This reuses the chapter's own explanation directly: "take the greatest common divisor of their distances, and the key length falls out." GCD(24, 18) = 6, matching the reasoning above. Using two independent repeated fragments rather than just one is what narrows the candidate list down from all of 24's factors to only the factors shared with 18 — exactly why the chapter's method calls for finding "several such repeated fragments" rather than relying on a single one, which alone would have left many more (wrong) candidates on the table.