Cryptography Reference
In-Depth Information
expected: is it a natural language (German, English?); a programming language
(C, C++, Fortran?); a database; a word processor? To find answers to these
questions, we need pattern files, in which the characters are distributed approx-
imately as we would expect from the plaintext. We use the simple program
distr found on our Web site, to analyze these files. This little program gives
us the relative frequencies of the characters in a file. We save the frequency
profile to a file.
For a starter, vigcrack reads the file, computes the kappa, κ P , of the
plaintext expected (appears on the screen), and finds the largest relative
frequency of a character (lines 30 through 47).
In line 51, the program reads as much of the ciphertext as possible; the
maximum is 40 Kbytes.
Next, the program computes the kappa, κ n , of the ciphertext shifted
against itself for each of the 64 possible password lengths, n . It takes
the result to compute the period duration rather pragmatically:
- It first minimizes the kappa, κ P , of the plaintext by one percentage
point and analyzes to see whether those n with κ n that exceed this
threshold are all multiples of the smallest of these n :
n, 2*n, 3*n, ...
- If so, then vigcrack takes this n as a period.
- Otherwise, it minimizes κ P again by one percentage point and repeats
the test.
If it doesn't find a period, it terminates the cryptanalysis. However, expe-
rience has shown that this very sharp test succeeds on this kind of files
that are usually long (lines 59 through 84).
Now that the period is known, vigcrack can compute the relative fre-
quencies of each of the ciphertext groups (lines 93 and 94).
Next, the program computes the square deviation of the distribution found
from the theoretical deviation for all possible 256 key characters. Since
the deviation is computed in a triple nested loop (the outer loop traverses
the period length), it requires a lot of computation time, which is the
reason why it has a pretest built in: if the most frequent character of
the plaintext transforms into a 'rare' character in the cipher, then the
 
Search WWH ::




Custom Search