06.01.2015 Views

Cryptology - Unofficial St. Mary's College of California Web Site

Cryptology - Unofficial St. Mary's College of California Web Site

Cryptology - Unofficial St. Mary's College of California Web Site

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.7. THE KASISKI TEST 121<br />

Kasiski’s idea was to not look directly for the length <strong>of</strong> the keyword, but to<br />

instead look for multiples <strong>of</strong> that length. Suppose a sequence <strong>of</strong> letters appears<br />

more than once in the plaintext. And suppose the plaintext and keyword are<br />

such that the same letters <strong>of</strong> the keyword encipher the same letters <strong>of</strong> these<br />

repeated bits. Then the resulting ciphertext would be the same.<br />

Now turn this around. If there is a repetition <strong>of</strong> some group <strong>of</strong> letters in<br />

the ciphertext, perhaps this was caused by the same plaintext letters being<br />

enciphered by the same keyword letters. If so, then the keyword would have<br />

had to repeat just the right number <strong>of</strong> times to fit both the first and second<br />

appearances <strong>of</strong> the plaintext letters. The distance these appearances are apart<br />

would then be a multiple <strong>of</strong> the keyword length. If we can find several such<br />

repetitions, so several such distances, then we ought to be able to focus in on<br />

the length <strong>of</strong> the keyword.<br />

To give a short example, consider the following cipher, with every fifth letter<br />

numbered ([Kahn], page 208):<br />

5 10 15 20 25 30<br />

K I O V I E E I G K I O V N U R N V J N U V K H V M G Z I A<br />

There are two repetitions here, one <strong>of</strong> KIOV and one <strong>of</strong> NU. The second KIOV<br />

starts at letter 10, the first at letter 1, so they occur a distance 9 apart. The<br />

second NU starts at letter 20, the first at letter 14, a distance <strong>of</strong> 6. Let’s put this<br />

information in a chart:<br />

Repetition <strong>St</strong>art Positions Distance Factors<br />

KIOV 1, 10 10 − 1 = 9 3 × 3<br />

NU 14, 20 20 − 14 = 6 2 × 3<br />

What number(s) are both 2 × 3 and 3 × 3 a multiple <strong>of</strong> 3. So, Kasiski would<br />

conclude, the keyword must be 3 letters long.<br />

In fact, the plaintext is To be or not to be. That is the question.<br />

and by putting the repeating keyword underneath we see that KIOV came from<br />

the combination <strong>of</strong> tobe and RUNR, and NU from th and UN:<br />

plaintext<br />

key<br />

ciphertext<br />

t o b e o r n o t t o b e t h a t i s t h e q u e s t i o n<br />

R U N R U N R U N R U N R U N R U N R U N R U N R U N R U N<br />

K I O V I E E I G K I O V N U R N V J N U V K H V M G Z I A<br />

Summarizing gives Kasiski’s Test.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!