Welcome Guest [Log In] [Register]
Viewing Single Post From: Cracking A Vig With Ic
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
Paarth Dave
May 11 2008, 04:46 AM
As you mentioned earlier,

...

How is the shifting related to the chi test?

I am confused yet again!

Think about the problem. We have a Vig ciphertext, that was encrypted with a keyword of length nine. That means that the characters 0, 9, 18, 27, ... were encrypted with one caesarshift, 1, 10, 19, 28, ... were encrypted with a second caesarshift, and so on, for a total of nine different caesar shifts.

Each Caesar shift is a simple substitution cipher implemented by adding a constant between 0 and 25 to the numeric value of each character in the plaintext.

The first thing we need to do to break a Vig is to figure out how long the keyword was. We've done that, with the IC, and found it was nine. The next thing we need to do is to determine the value of each letter of the keyword. Which is to say, we need to find out by how much each slice of the text was shifted.

There are nine letters in the keyword, so the text can be divided into nine slices, so that all of the letters in a slice were encrypted with the same letter from the keyword.

We take each slice, individually, and do a frequency count, and then use the chi test to measure how similar it is to ordinary text. If that slice was not shifted - which is to say that the letter of the keyword that was used to encrypt that slice was 'A', or 0 - the chi test will have a value of over 0.06. If it's a poor fit, the chi test will have a value below 0.04.

So we subtract 1 from each letter in the slice, do a new frequency count, do another chi test comparing it to standard English, and then repeat, until we've done this for every number between 0 and 25. When we're done, we'll have the results of 26 chi tests. And in almost every case, the case in which the chi test returned the highest value will be the one where subtracted the correct amount. If the chi test had the highest result when we were subtracting 6, that means that the letter in the keyword that was used to encrypt this slice was 'G' (A=0, B=1, C=2, D=3, E=4, F=5, G=6).

Then we need to do the same thing, for each of the other eight slices.

That's 9 slices * 26 chi tests = 234 chi tests.

You can see why people invented computers.
When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
Offline Profile Quote Post
Cracking A Vig With Ic · General