| Viewing Single Post From: Cracking A Vig With Ic | |
|---|---|
| jdege | May 13 2008, 12:41 PM |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
There are two parts to the problem. Identifying the keylength, and identifying the shifts. I know of two other methods of identifying the keylength. The first is the Kasiski method - you look for repeated ngrams - sequences of characters that appear more than once. You factor the distances between the repeats, and look for common factors. English text contains repeats. When these repeats line up with the key, the repeats will show up in the cipher text.
We have a code-word of length 8, and we have three repeats. MLQ appears at positions 0 and 8, distance 8 ML appears at positions 0, 8, and 16, distances 8 and 8 So we have a keyword of length 8 - or possibly 2 or 4. Normally, you need a lot more text to get enough repeats to be certain, and it's normal to get distances that are multiples of the keyword length. If your keyword length is 7, you might get distances of 14, 21, and 35. 7 is the common denominator. Also keep in mind that you will see occasional accidental repeats, that have nothing to do with the keylength. The other method I've never seen named, but it's mentioned in Schneier's "Applied Cryptography". The idea is to compare the text to itself, shifted by various amounts. When the text is shifted by the length of the keyword, you should see a higher number of matching letters. Schneier talks about subtracting the texts, and looking for zeros. By hand, it's easier to just look for matches. Write out the text on a strip of paper. Then write out the text twice on another strip of paper. Then lne them up, shift one over by one letter, and count how many times the same letter appears on both strips. When you have shifted by the length of the keyword you will see far more matches than you will otherwise.
You expect to see matches in about 6% of the cases when you have the text aligned properly, and in about 4% of the cases when you don't. In this case, you see a lot more, because I intentionally chose the text to have repeats at the keyword length. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Cracking A Vig With Ic · General | |




![]](http://209.85.122.85/static/1/pip_r.png)


7:47 PM Nov 24