Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any software for testing sequences for non-randomness in Java?

I looking for a program or library in Java capable of finding non-random properties of a byte sequence. Something when given a huge file, runs some statistical tests and reports if the data show any regularities.

I know three such programs, but not in Java. I tried all of them, but they don't really seem to work for me (which is quite surprising as one of them is by NIST). The oldest of them, diehard, works fine, but it's a bit hard to use.

like image 827
maaartinus Avatar asked Jan 31 '11 02:01

maaartinus


People also ask

Which test is used for testing randomness?

The runs test is a statistical test to determine whether random selection has been made in the process of sample selection from an ordered population. The runs test is a type of non-parametric test and hence, there is no need for the assumption of a normal distribution to hold true.

How do you test the randomness of a PRNG?

There are two phases to test the random number generator process. First you need a source of entropy[1] that is impossible to guess like the weather. Second you need a deterministic algorithm to expand the seed into a multitude of sequences for keys and the like. Testing usually starts with checking your entropy.


1 Answers

As some of the commenters have stated, this is really an expert mathematics problem. The simplest explanation I could find for you is:

Run Tests for Non-randomness

Autocorrelation

It's interesting, but as it uses 'heads or tails' to simplify its example, you'll find you need to go much deeper to apply the same theory to encryption / cryptography etc - but it's a good start.

like image 52
Michael Avatar answered Sep 20 '22 22:09

Michael