I'm studying for random number generators(RNG) and I saw about machine learning a few days ago. So I searched analysis of RNG using machine learning. But I couldn't find such fields. Are there such examples for analysis of RNG using machine learning? No matter some papers of articles.
The goal of an ideal cryptographically secure pseudo-random number generator (CSPRNG) is to produce a stream of numbers that no machine can distinguish from a truly random stream of numbers. Formally, it's
impossible unknown whether it's possible to prove that a CSPRNG is truly random.
That being said, there exists a family of statistical tests that can measure whether a sequence of numbers appears to be uniformly random, and produce a probabilistic analysis as output. I'm not sure if these tests qualify as related to machine learning, but here are some examples:
If you are interested in trying out a CSPRNG, you can use:
- AES-CTR with a random key acting as the seed.
- Under Linux, Mac OS X, BSD,
window.crypto.getRandomValues()in your browser console (Chrome, Firefox).
Note that not all PRNGs are CSPRNGs.
Consider the limitations of such an analysis. It can summarily reject a PRNG as being insufficiently random by demonstrating that the outputs are predictable by a computer program. However, its ability to generate comfort as to the randomness of a PRNG is limited. We have mathematicians going through hoops with months of mathematical analysis to prove that a flaw exists, much less find the flaw outright. Often a "broken" algorithm is shown to break after petabyes of random numbers, which becomes an indication that it will continue to be attacked in less and less time, until any old laptop can break it. Those studying PRNGs would want a little more warning than "a computer program has actually cracked it."
It might be interesting to use such machine learning programs for high performance PRNGs that do not have any cryptographic guarantees. They might be able to help explain to a programmer or artist the limitations of a particular PRNG choice for their particular job, rather than relying on highly abstract measures of unpredictability.
The NIST test suite for random numbers implements "short-term memory" machine learning algorithms.
It needs to save and categorize all relevant data to be "long-term memory" machine learning.
You may use binary classification algorithm like decision tree and have two learning data sets one which has the truly random bytes and the other puesudo random bytes. As you might probably know, you have to specify the size of every record say for example 1k.
It is really a good idea.