in reply to TRNG Perl script query
A little thought about the source of randomness (entropy) indicates that this is unlikely to be a very good random number source. The "randomness" comes from the variable time it takes to execute a loop, so what causes the reported loop execution time to change? Well, in a modern multi-tasking operating system most of the variation will be due to other tasks running during the loop time. So the processor running your for loop will potentially "slice" its time between several tasks. The important factor is, how consistent are the slice times?
On busy systems with internet browser windows open or various other tasks interacting with the real world there will be a range of slice times because the real world interactions introduce a fair whack of entropy. On quiet systems there will be only a small variation in slice times because the only "random" stuff going on will be things like the real time clock interrupt so there will be very little entropy introduced and the random number generated will be poor.
Note that measuring the quality of random numbers is hard and requires some fairly high powered maths and statistical techniques. Depending on your use for the numbers, correlations between numbers in a sequence can be al least as important a measure as the actual distribution of the numbers. I would be exceedingly surprised if your simple TRNG actually generates statistically robust random number sequences.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: TRNG Perl script query
by AnomalousMonk (Archbishop) on Jan 27, 2014 at 03:46 UTC |