Welcome Guest [Log In] [Register]
Viewing Single Post From: Cracking A Vig With Ic
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
Paarth Dave
May 13 2008, 02:25 AM
Quote:
 
You can see why people invented computers.


Ya..You are right.

Is there any shorter way than this to break a Vig manually i.e with paper and pencil?
For me, this method is quite tedious but effective also.

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.
Code:
 

these areth etime sthat tryme nssou ls
TEMPL ATETE MPLAT ETEMP LATET EMPLA TE
MLQHP AKIML QITMX WMLMI ERRQX REHZU EW

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.
Code:
 

 MLQHPAKIMLQITMXWMLMIERRQXREHZUEWMLQHPAKIMLQITMXWMLMIERRQXREHZUEW
  MLQHPAKIMLQITMXWMLMIERRQXREHZUEW
  ---------------------+----------   1

 MLQHPAKIMLQITMXWMLMIERRQXREHZUEWMLQHPAKIMLQITMXWMLMIERRQXREHZUEW
   MLQHPAKIMLQITMXWMLMIERRQXREHZUEW
   ----------------+---------------  1
 MLQHPAKIMLQITMXWMLMIERRQXREHZUEWMLQHPAKIMLQITMXWMLMIERRQXREHZUEW
         MLQHPAKIMLQITMXWMLMIERRQXREHZUEW
         +++-----++----------------------  5

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.
Offline Profile Quote Post
Cracking A Vig With Ic · General