miércoles, 29 de agosto de 2012

Frecuency Monobit Test




hi , in this second week we had to test whether the keys we generated in our one time pad, were really random.

And to see if you really are random generated keys, I did Monobit Frequency by Test.

and formulas necessary for this test are:

sobs = | S | / √ n

where:
n = Length of the bit string.
s = X1 + X2 + ... + Xn, where Xi = 2εi - 1 (conversion to ± 1)

P-value = erfc (sobs / √ 2)

And just if P-value> = 0.01 then you could say it is random otherwise is not random.


source code:

some screenshots:


Any comments or suggestions make me know!!

references:
http://teal.gmu.edu/courses/ECE746/project/slides_2008/RNG_Tests_slides.pdf
http://www.fi.muni.cz/ ~ xkrhovj/lectures/2005_PA168_Statistical_Testing_slides.pdf


1 comentario: