If you ever wondered how hardware RNGs work... - Page 1
Forum section: electronics / general

author: BrianHG
author_rank: Super Contributor
timestamp: June 08, 2017, 07:54:02 am
content: LOL, I'm sorry to say that much better hardware random-number generators which measure electrons or photons work much better and much faster without mechanical breakdown.

author: Berni
author_rank: Super Contributor
timestamp: June 09, 2017, 08:08:38 am
content: Quote from: BrianHG on June 08, 2017, 07:54:02 amNone of them are nearly as fun as this mechanical implementation tho. Can't watch electrons zooming around.

author: Red Squirrel
author_rank: Super Contributor
timestamp: June 09, 2017, 11:43:58 pm
content: Haha that's pretty cool. You can up the randomness by throwing in some D&D dices in there.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 10, 2017, 05:25:23 am
content: Random.org uses an AM radio tuned to static.There was also one like the above, but which flipped the dice, IIRC. Or maybe I'm misremembering one of Tim Hunkin's classic machines!Tim

author: timb
author_rank: Super Contributor
timestamp: June 10, 2017, 06:47:39 am
content: Quote from: T3sl4co1l on June 10, 2017, 05:25:23 amYeah, because *that* wouldn't be hard to hack for anyone within broadcast range of their location.

author: BrianHG
author_rank: Super Contributor
timestamp: June 10, 2017, 06:58:19 am
content: Any white noise generator would do tied to an ADC. Some HRNGs just use the noise in the LSB of an ADC, + some additional code to 'whiten' the results. For some of the white noise generators, I believe the noise of a reverse biased pin diode is amplified and used.https://en.wikipedia.org/wiki/Hardware_random_number_generatorList with which method many different HRNGs which are available:https://en.wikipedia.org/wiki/Comparison_of_hardware_random_number_generators

author: VK3DRB
author_rank: Super Contributor
timestamp: June 10, 2017, 07:36:53 am
content: Quote from: evb149 on June 10, 2017, 06:18:43 amNone of these are random. Randomness does not exist, never has, never will be. You cannot disprove this. OK, to the observer, the outcome might not be able to be predicted by a human, but that does not mean it is random. Anyone who has studied chemistry and physics will know everything, EVERYTHING has a cause.

author: electr_peter
author_rank: Unknown
timestamp: June 10, 2017, 05:23:30 pm
content: Even lava lamp based random number generators exist.Why Car Companies Are Hiring Computer Security Experts, NY TimesQuote

author: filssavi
author_rank: Frequent Contributor
timestamp: June 10, 2017, 06:25:32 pm
content: Quote from: VK3DRB on June 10, 2017, 07:36:53 amAnyone who truly studied phisycs (quantum mechanics) knows that true randomness exists full wellAmong true random effects used today to build HRNG there is:Radioattive decayShot noise of electrons passing a barrierThen there is thermal noise which is not fully random (some of it is at the core due to Heisenberg uncertainty principle) but in a non cryogenically cooled system is ad good as randomIf we talk about Coin tosses and dice throws then you have a point

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 10, 2017, 07:07:26 pm
content: Most systems consist of an object or structure with finite states, and a mixing function that quickly (chaotically) scrambles that state.PRNGs have this property explicitly, even for very regular mixing functions like theLogistic map.Mechanical systems (like the above machine) have explicit mixing functions as well, but the mechanical tolerances are intentionally poorly defined, and the amount of mixing depends upon initial die state as well as the state of nearby dice (in case they collide). Predicting outcomes from mechanical measurements are unlikely to even be helpful, because the mechanical tolerances of the dice are much too loose, and vary as they are cycled through the system and worn down.Related topic:https://en.wikipedia.org/wiki/Physical_unclonable_functionTim

author: floobydust
author_rank: Super Contributor
timestamp: June 10, 2017, 10:03:56 pm
content: I have many dice that love to give one number, great for certain board games.Dice are not totally random. Imbalanced centroid due to the indents from the markings. 6 on one side, 1 on the opposite side. They are imperfect cubes and chamfered with little precision.I recall this info from a casino study or something.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 10, 2017, 11:33:00 pm
content: Yeah, casinos have a vested interest in making sure their dice are even -- or at least, not against their favor.AFAIK, they make them by filling the indents?There are ways to clean up biased trials -- usually, feeding the bitstream into an LFSR or hash function. This would be wise especially for anything that might be externally tampered with (say by adjusting the temperature or voltage or EMI applied to a hardware RNG, or locating an atmospheric radio RNG and influencing it).Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 11, 2017, 12:11:19 am
content: Dunno -- I haven't had reason to be concerned about those things.https://en.wikipedia.org/wiki//dev/randomsays urandom is reseeded from the same entropy store, which should be fine. If you call too frequently, you'll empty the store, but you won't be blocking.https://www.2uo.de/myths-about-urandom/seems to suggest that one is better than the other.Applying additional (undisclosed*) mixing processes (which are themselves statistically sound) would seem like a good idea.*This is a bad idea, in the sense that it's "security through obscurity". That said, I have to wonder if anyone's tried this: there is no shortage of crypto functions out there today; why not implement all of them, and choose between each one (at a suitable step or round) based on another random number, which might itself be produced by a similar process? It's still not going to protect against perfect knowledge (that an attacker has the initial data or entropy, and the algorithm), of course.Tim

author: Red Squirrel
author_rank: Super Contributor
timestamp: June 11, 2017, 01:58:54 am
content: I guess the question of randomness is just how random do you actually need. If you can't reliably predict what the next sequence of numbers is going to be, and that each possibility is fairly equally chosen, it's probably random enough for most purposes. Physical stuff, especially mechanical is going to be rather random as mechanical devices arn't perfect so the dices are never going to fall the same exact way, even though the machine might be repeating a cycle of moving them up and letting them drop. One random result is going to lead to the next, and so on. Technically the person placing the dice in the machine would be the seed and the rest is sorta predetermined from there, but even if the person was to place the dice EXACTLY in the same spot, molecule per molecule, and the machine's mechanical parts were at the exact same spot, I bet you'd still get a different result. Things like air pressure, temperature, humidity etc will probably somewhat affect how it falls, bounces, slides etc.

author: timb
author_rank: Super Contributor
timestamp: June 11, 2017, 02:01:50 am
content: Quote from: evb149 on June 10, 2017, 06:54:40 amFirst off, if the "noise source" is a station transmitting real information (as opposed to static) then it's not really random anymore, is it? If you're generating entropy from that source and then using that to generate cryptographic keys, it would be a lot easier for me to break those keys, because I could just tune to the same station and I would get a similar entropy pool.Secondly, I can hook a few inches of copper wire to the output of my 1-250MHz Leveled Sinewave Generator, set it to 1Vp-p@90MHz and it will completely knock out the reception of an FM station at that frequency in a 10ft radius. If I had an actual transmitter with a properly matched antenna I wouldn't have any problems sitting outside of a building and overriding a signal on frequency.There's actually some software that turns a RTL based SDR dongle into a RNG source (called rtl-entropy). They recommend terminating the input of the dongle with 75 ohms and placing it in a shielded box, to avoid the situation I described.