ent

Z funus.net

ent to poręczny programik testujący sekwencje liczb pseudolosowych w celu określenia, jak bardzo są one zbliżone do losowych. Operuje na bajtach lub bitach (do wyboru).

Przykład użycia:

$ dd if=/dev/urandom of=/tmp/rnd bs=1c count=512k
$ ent /tmp/rnd
Entropy = 7.999603 bits per byte.

Optimum compression would reduce the size
of this 524288 byte file by 0 percent.

Chi square distribution for 524288 samples is 288.52, and randomly
would exceed this value 10.00 percent of the times.

Arithmetic mean value of data bytes is 127.5622 (127.5 = random).
Monte Carlo value for Pi is 3.145580847 (error 0.13 percent).
Serial correlation coefficient is 0.000144 (totally uncorrelated = 0.0).

Ten sam plik w trybie bitowym:

$ ent -b /tmp/rnd
Entropy = 0.999999 bits per bit.

Optimum compression would reduce the size
of this 4194304 bit file by 0 percent.

Chi square distribution for 4194304 samples is 3.20, and randomly
would exceed this value 10.00 percent of the times.

Arithmetic mean value of data bits is 0.5004 (0.5 = random).
Monte Carlo value for Pi is 3.145580847 (error 0.13 percent).
Serial correlation coefficient is -0.000308 (totally uncorrelated = 0.0).

Hmm, test chi-kwadrat wykazuje, że plik jest na granicy "prawie podejrzanego" o to, że nie zawiera danych losowych...