NIST Statistical Test Suite [http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html]
Installed the NIST tool on my laptop and carried out the basic tests
given in Appendix B to ensure that it worked. I have attached the entire
test results here. However, the values showed in Appendix B
is the collection of p-values for each of the 15 tests run for data.pi (found in results.txt under each test folder)
and that can be found here. These results match those in the
appendix.
Then proceeded to test some of the outputs from the SHA-3 candidates, namely, Blake-256, Skein-256 and Skein-512. The p-values tabulation can be found here. The entire test result for Skein-512 is zipped
Some of the test results are consistently 0.0000 for some of the tests across all three candidates. I think for these tests to be carried out successfully the input file needs to be of a larger size. The following are the minimum bits length for the tests that failed
Rank - 38,912 bits
Random Excursions - 1,000,000 bits
Random Excursions Variant - 1,000,000 bits
PS : The tests on the SHA-3 candidates were run with sequence length of 256 for blake-256 and skein-256 and 512 for skein-512. The number of bit streams was set to 1.
Other than the linear complexity block size (set to 256 for the two-256 candidates), none of the other modifiable parameters were changed.
UPDATE(04/14/2011)
The smallest unit in Java is bytes so I set the k value considering b as bytes. The tool has an option (Binary option) to deal with bytes.
k = 4000
If O/p is 256 bits, 32 bytes x 4000 = 128000 bytes = 1,024,000 bits
If O/p is 512 bits, 64 bytes x 4000 = 256000 bytes = 2,048,000 bits
For i = 0 to 3999, produced H(i) and then generated 2 outputs
1) Appended all H(i) in sequence. [RowSkein512.txt]
2) For 0 to 63, appended every 64th byte so that they are done column-vice
For ex., first take 0,
append 0,64,128....keep adding 64 until no> 256000
then take 1 and so on... [ColSkein512.txt]
Results : summary of p-values and the entire result for row and column tests.
UPDATE (4/20/2011) - CONFIRMING THE JAVA CODE
I was able to confirm the output of the code with the sample outputs given in the Skein document. I have attached the original Skein examples and the output obtained from the Java code.
As you can see, the first two outputs confirm to the one's given in the sample Skein document. The bit format output also conforms to the hex output.
However, there is one deviation, the third message 'C9375ECE'. The original length of the message is 31 bits but when I convert it to bytes it is converted to 32 bits. It always becomes a multiple of 8, understandably. So, the output is not the same as that given in the Skein document. The other two inputs work because they are multiples of 8 and converting them to bytes results in a 'correct' conversion. This is not a reflection of the java code of the hash function because in the third case we are feeding an extra bit and hence the output is different. It is not really important to what we are investigating, the proper functioning of the java code, but I thought I should mention it.
UPDATE (4/27/2011)
Four different inputs were obtained using the following techniques for statistical testing with the tool
1. Numbers 0-3999.
2. 2048 inputs used in shortmsgkat_512.txt by Bruce Schneier. This input is apparently known in the community.
3. The file “SP800-22rev1a.pdf” about the NIST Statistical Test Suite for Randomness from the NIST website. It is about 6.5MB. Each input should have n=10kB (kilobytes). The first input is the first 10kB, the second skips the first m = 1 kB and takes the next n=10kB, the third one skips 2*m kB, and so on. So, the last input will skip 3,999 kB and take 10 kB. This way we have some overlapping and some non-overlapping.
4. Like in Variant 3, but take n = 100 kB and skip every m = 100 Bytes. So, there will be more overlapping.
The tabulated results can be found here
UPDATE(5/2/2011)
There were two problems in the above results : one being the output of the 0-3999 hashes and the other being that the test was not run for the entire length of the outputs bits.
The problem of the number hashes was with the conversion in Java and not with the file creation or the hash functions. Ran the tests for all the output bits and the results can be found here
Conclusion : None of the final five candidates failed the statistical tests comprehensively. Although there were some failed results here and there, they are not enough to doubt the randomness of the candidates.
Then proceeded to test some of the outputs from the SHA-3 candidates, namely, Blake-256, Skein-256 and Skein-512. The p-values tabulation can be found here. The entire test result for Skein-512 is zipped
Some of the test results are consistently 0.0000 for some of the tests across all three candidates. I think for these tests to be carried out successfully the input file needs to be of a larger size. The following are the minimum bits length for the tests that failed
Rank - 38,912 bits
Random Excursions - 1,000,000 bits
Random Excursions Variant - 1,000,000 bits
PS : The tests on the SHA-3 candidates were run with sequence length of 256 for blake-256 and skein-256 and 512 for skein-512. The number of bit streams was set to 1.
Other than the linear complexity block size (set to 256 for the two-256 candidates), none of the other modifiable parameters were changed.
UPDATE(04/14/2011)
The smallest unit in Java is bytes so I set the k value considering b as bytes. The tool has an option (Binary option) to deal with bytes.
k = 4000
If O/p is 256 bits, 32 bytes x 4000 = 128000 bytes = 1,024,000 bits
If O/p is 512 bits, 64 bytes x 4000 = 256000 bytes = 2,048,000 bits
For i = 0 to 3999, produced H(i) and then generated 2 outputs
1) Appended all H(i) in sequence. [RowSkein512.txt]
2) For 0 to 63, appended every 64th byte so that they are done column-vice
For ex., first take 0,
append 0,64,128....keep adding 64 until no> 256000
then take 1 and so on... [ColSkein512.txt]
Results : summary of p-values and the entire result for row and column tests.
UPDATE (4/20/2011) - CONFIRMING THE JAVA CODE
I was able to confirm the output of the code with the sample outputs given in the Skein document. I have attached the original Skein examples and the output obtained from the Java code.
As you can see, the first two outputs confirm to the one's given in the sample Skein document. The bit format output also conforms to the hex output.
However, there is one deviation, the third message 'C9375ECE'. The original length of the message is 31 bits but when I convert it to bytes it is converted to 32 bits. It always becomes a multiple of 8, understandably. So, the output is not the same as that given in the Skein document. The other two inputs work because they are multiples of 8 and converting them to bytes results in a 'correct' conversion. This is not a reflection of the java code of the hash function because in the third case we are feeding an extra bit and hence the output is different. It is not really important to what we are investigating, the proper functioning of the java code, but I thought I should mention it.
UPDATE (4/27/2011)
Four different inputs were obtained using the following techniques for statistical testing with the tool
1. Numbers 0-3999.
2. 2048 inputs used in shortmsgkat_512.txt by Bruce Schneier. This input is apparently known in the community.
3. The file “SP800-22rev1a.pdf” about the NIST Statistical Test Suite for Randomness from the NIST website. It is about 6.5MB. Each input should have n=10kB (kilobytes). The first input is the first 10kB, the second skips the first m = 1 kB and takes the next n=10kB, the third one skips 2*m kB, and so on. So, the last input will skip 3,999 kB and take 10 kB. This way we have some overlapping and some non-overlapping.
4. Like in Variant 3, but take n = 100 kB and skip every m = 100 Bytes. So, there will be more overlapping.
The tabulated results can be found here
UPDATE(5/2/2011)
There were two problems in the above results : one being the output of the 0-3999 hashes and the other being that the test was not run for the entire length of the outputs bits.
The problem of the number hashes was with the conversion in Java and not with the file creation or the hash functions. Ran the tests for all the output bits and the results can be found here
Conclusion : None of the final five candidates failed the statistical tests comprehensively. Although there were some failed results here and there, they are not enough to doubt the randomness of the candidates.