Mr RB
Well-Known Member
MrAl said:...Normally when i say 'generator' i mean an algorithm that is purely mathematical in some way and does not include real world chaos of any kind.
...
I already have a well tuned software PRNG here;
https://www.romanblack.com/black_rng.htm
which has a massive number of states, greater than any standard software RNG I have seen. It also changes its algorithm over time, and randomly mixes data processed with older algorithms with data from the new algorithm, two features not generally seen on software RNGs.
It would be good to hear more ideas on a very simple hardware system to generate some entropy, when I said "self contained" that means the simple hardware makes the entropy and all the PIC needs to do is measure it, preferably time based measurement as that rules out the issues caused by voltage based (ADC) type measurements.
Something with a few gates or a few transistors, that reacts chaotically but also reliably would be perfect. Maybe a simulator job?
()blivion said:..."RC slope->digital input triggering points are always unpredictable"
If it's non-Schmidt triggered, yes. That's the illegal logic area which is classified as "result not determinable". I have always though of this and wanted to try and develop a RNG based on this practice, but digital logic's tend to fry when you put their inputs in the "illegal zone". And that scares me <)
I would use schmidt gates, for reliability. They still have some uV or mV of fuzziness on the triggering edges, which is enough to add to the overall entropy of the reaction.
Jpanhalt said:...It returns a result for 900,000 to 900,009 as 3587510954. Do you know whether that is correct? I only memorized pi to 10 decimal places (1415926535). At least it checks out that far.
...
Thanks for the link to the Pi tester. (Also thanks to ()blivion for the other Pi software link). I have already downloaded some Pi files, but unfortunately they are all in decimal!! Raw Pi itself is essentially a "random" number but converting it into decimal may corrupt it? My software really needs binary data to run the tests properly and can only do some basic data counting when the data is decimal (no nice displays).
(Added) I ran the test on 1.25Mb of Pi from the file from the Gutenberg book, and compared to 1.25Mb of "random" decimal digits 0-9 generated by Rand(10).
Pi looks to be VERY inline with what you would expect from a perfectly random sequence. It has no digit bias, matching the random data exactly. The only small difference I can detect is in the 2 digit pairs, Pi shows a slightly smoother distribution than rand(10) for the most common 2 digit pairs, but they are so close as to both be comsidered "good" random data;
Code:
(note! there are 10 digits 0-9, as ascii 48-57)
Results from 1254540 bytes of Pi (Gutenberg book);
Byte-aligned 2byte freq (largest 20);
'Perfect' next byte freq = 12545.4 times
53, 53 = 12876 times
50, 55 = 12834 times
57, 52 = 12772 times
53, 52 = 12726 times
49, 57 = 12724 times
54, 48 = 12720 times
51, 48 = 12715 times
50, 49 = 12707 times
52, 54 = 12706 times
50, 50 = 12698 times
48, 57 = 12697 times
51, 55 = 12696 times
56, 56 = 12685 times
57, 56 = 12672 times
57, 57 = 12656 times
56, 51 = 12655 times
51, 51 = 12642 times
55, 54 = 12640 times
51, 53 = 12636 times
50, 52 = 12633 times
Results from 1254540 bytes of rand(10);
Byte-aligned 2byte freq (largest 20);
'Perfect' next byte freq = 12545.4 times
54, 50 = 12949 times
54, 56 = 12877 times
54, 49 = 12848 times
53, 54 = 12844 times
53, 48 = 12830 times
51, 54 = 12780 times
48, 54 = 12747 times
57, 54 = 12738 times
54, 53 = 12706 times
50, 51 = 12698 times
52, 54 = 12691 times
56, 54 = 12667 times
50, 54 = 12658 times
56, 51 = 12656 times
56, 56 = 12655 times
52, 52 = 12654 times
56, 55 = 12651 times
55, 53 = 12627 times
54, 48 = 12623 times
51, 57 = 12619 times
Maybe MisterT can comment on this comparison his statistics math was pretty good if I remember right.