> De første 38 sider er en gennemgang af diverse pseudo random generatorer.
> Resten er metoder til analyse hvor god en given metode er.
>
> /hjj
Tak for de svar der er kommet, dejligt at se man har holdt sig til emnet
Jeg har interesse i emnet, da mange former for kryptering afhænger af at
have adgang til random data af høj kvalitet, og det er jo nemt at ønske, men
som tråden har udviklet sig her, ses det at kontrollen af kvaliteten af de
random data kan være et problem.
Et af de programmer jeg har kikket på, der hævder at bruge stærk kryptering,
har en indbygget Phi test, hvor man efterfølgende kan teste den kryptering
programmet har udført, men at Phi testen viser at det er en poly alfabetisk
kryptering, viser jo ikke noget om eventuelle svagheder i random
generatoren. har jeg ret i den antagelse ?
Mvh.
Lene
Ps sender data med om phi testen
Phi Test
There are statistical tests that can be done on a file to see if it is
enciphered or created in a random manner or not. One such test is called the
Phi Test.
There are a few terms that have to be defined first. The first is Kappa sub
r (r for random) that for the 26-letter English alphabet is .0385. What this
value says is that there is a 3.85 percent chance of drawing any two letters
that are the same out of two urns that contain the 26-letter alphabet. The
second value is Kappa sub p (p for plaintext) that is equal to .0667 for
English. If you have two urns that each contain 100 letters in the
proportion in which they are used in normal text there is a 6.67 percent
chance of drawing any two letters that are the same.
The Kappa sub r value of .0385 for the 26-letter alphabet is equal to 1/26.
If you take the 30-letter Russian Cyrillic alphabet the Kappa sub r value is
..0333 or 1/30. For the 256 characters used by a computer the Kappa sub r
value is .00390625 or 1/256.
The Phi Test can determine whether a given frequency count reflects a
monalphabetic or a polyalphabetic encipherment. A frequency table for a
monalphabetic enciphered file will reflect the same distribution table as
text in normal use. A frequency table for a polyalphabetic enciphered file
will just reflect random text. To use it you first multiply the total number
of characters in a file by the total number minus one. If the total number
of characters is 17,539 then multiply 17,539 by 17,538. Then multiply this
product by the Kappa sub r value of .00390625. The result will be the
polyalphabetic expected Phi. I do not have a Kappa sub p value for the
256-character set on a computer. I suspect that it would be fairly close to
the Kappa sub p value for the 26-letter alphabet since most of the time you
would be enciphering English text. For the purposes of this test this value
is not needed.
Next take the frequency count of each character and multiply it by its
frequency count minus one. If the frequency count for character A is 461
then you multiply 461 by 460. When this is done for all 256 characters, add
the 256 products together to get one final value. This is the observed Phi
value. The following values are from a text file enciphered by the author.
File Name: yhm.tsc
File Size: 218,367
Expected Phi Value (Kappa Sub r): 186,265,345.000000
Observed Phi Value: 186,297,966.000000
Mean Value: 852.996094
Variance (s²): 980.921553
Standard Deviation: 31.319667
As you can see the observed Phi value is very close to the expected Phi
value Kappa Sub r. This means that the frequency count for all 256
characters is based on a polyalphabetic encipherment. In other words, the
frequency distribution for all 256 characters is completely random in
nature. If it had been a monalphabetic encipherment, the frequency
distribution would have been more in line with an expected Phi value Kappa
Sub p that would have been a value approximately 16 times larger than
186,265,345. The Mean Value for the frequency distribution, the Variance
(s²), and the standard deviation are also given.
An in depth explanation of both of the Phi and Chi tests is presented on
pages 377 to 382 in The Codebreakers by David Kahn and published by The
Macmillan Company.