
For the latest news and information visit The GNU Crypto project 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object gnu.crypto.tool.Ent
This is a Java implementation of Ent (A Pseudorandom Number Sequence Test Program) developed by John Walker) which applies various tests to sequences of bytes generated by the GNU Crypto library pseudorandom number generator implementations.
It is useful for those evaluating pseudorandom number generators for encryption and statistical sampling applications, compression algorithms, and other applications where the various computed indices are of interest.
For a designated PRNG algorithm, this class computes the following indices:
Applying this test to the output of various pseudorandom sequence generators is interesting. The loworder 8 bits returned by the standard Unix rand() function, for example, yields:
Chi square distribution for 500000 samples is 0.01, and randomly would exceed this value 99.99 percent of the times.While an improved generator [Park & Miller] reports:
Chi square distribution for 500000 samples is 212.53, and randomly would exceed this value 95.00 percent of the times.Thus, the standard Unix generator (or at least the loworder bytes it returns) is unacceptably nonrandom, while the improved generator is much better but still sufficiently nonrandom to cause concern for demanding applications. Contrast both of these software generators with the chisquare result of a genuine random sequence created by timing radioactive decay events.
Chi square distribution for 32768 samples is 237.05, and randomly would exceed this value 75.00 percent of the times.See [Knuth, pp. 3540] for more information on the chisquare test.
zero
. A nonrandom byte stream such as a
C program will yield a serial correlation coefficient on the order of
0.5
. Wildly predictable data such as uncompressed bitmaps
will exhibit serial correlation coefficients approaching 1
.
See [Knuth, pp. 6465] for more details.
Constructor Summary  
Ent(IRandom prng)


Ent(java.lang.String name,
java.security.SecureRandom prng)

Method Summary  
void 
computeIndices()

double 
getChiSquare()

double 
getChiSquareProbability()

long 
getDuration()

double 
getMean()

double 
getMeanPercentDeviation()

double 
getPi()

double 
getPiPercentDeviation()

double 
getSerialCorrelationCoefficient()

long 
getSetBits()

long 
getTotalBits()

static void 
main(java.lang.String[] args)

Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 
public Ent(IRandom prng)
public Ent(java.lang.String name, java.security.SecureRandom prng)
Method Detail 
public static void main(java.lang.String[] args)
public void computeIndices() throws LimitReachedException
LimitReachedException
public long getDuration()
public long getTotalBits()
public long getSetBits()
public double getMean()
public double getMeanPercentDeviation()
public double getChiSquare()
public double getChiSquareProbability()
public double getSerialCorrelationCoefficient()
public double getPi()
public double getPiPercentDeviation()

For the latest news and information visit The GNU Crypto project 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 