Author Topic: If you ever wondered how hardware RNGs work...  (Read 6212 times)

0 Members and 1 Guest are viewing this topic.

Offline daqqTopic starter

  • Super Contributor
  • ***
  • Posts: 2314
  • Country: sk
    • My site
If you ever wondered how hardware RNGs work...
« on: June 08, 2017, 07:46:07 am »
Believe it or not, pointy haired people do exist!
+++Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
 
The following users thanked this post: electr_peter

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8094
  • Country: ca
Re: If you ever wondered how hardware RNGs work...
« Reply #1 on: June 08, 2017, 07:54:02 am »
 :popcorn:  :-DD 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.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5026
  • Country: si
Re: If you ever wondered how hardware RNGs work...
« Reply #2 on: June 09, 2017, 08:08:38 am »
:popcorn:  :-DD 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.

None of them are nearly as fun as this mechanical implementation tho. Can't watch electrons zooming around.
 

Offline Red Squirrel

  • Super Contributor
  • ***
  • Posts: 2751
  • Country: ca
Re: If you ever wondered how hardware RNGs work...
« Reply #3 on: June 09, 2017, 11:43:58 pm »
Haha that's pretty cool.   You can up the randomness by throwing in some D&D dices in there.  :-DD
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22408
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: If you ever wondered how hardware RNGs work...
« Reply #4 on: June 10, 2017, 05:25:23 am »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: If you ever wondered how hardware RNGs work...
« Reply #5 on: June 10, 2017, 06:47:39 am »
Random.org uses an AM radio tuned to static. :)

Tim

Yeah, because *that* wouldn't be hard to hack for anyone within broadcast range of their location.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8094
  • Country: ca
Re: If you ever wondered how hardware RNGs work...
« Reply #6 on: June 10, 2017, 06:58:19 am »
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_generator
List with which method many different HRNGs which are available:
https://en.wikipedia.org/wiki/Comparison_of_hardware_random_number_generators
« Last Edit: June 10, 2017, 07:01:19 am by BrianHG »
 
The following users thanked this post: evb149

Offline VK3DRB

  • Super Contributor
  • ***
  • Posts: 2261
  • Country: au
Re: If you ever wondered how hardware RNGs work...
« Reply #7 on: June 10, 2017, 07:36:53 am »
So what else do we have in terms of "simple" schemes for taking and digitizing true randomness that is accessible to DIY tinkering?

Resistor thermal noise.  Ok.  That's easy.

Zener noise.  Ok.  That's easy.

Measuring the noise of decay events of some isotope or similar unpredictable particle flux.  Ok.  That's easy.

I seem to recall one about measuring the noise of pixels in an image sensor or something like that.

I recall other schemes about slowly / asynchronously  sampling the composite values of several uncontrolled free running high frequency oscillators.

Roll dice / flip coins and detect the result of course.

Timestamp photons arriving from a weak (attenuated until the rate is suitably countable)  incandescent source I suppose...?

Something to do with Brownian motion of particles and measuring that maybe?

None 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.
 

Offline electr_peter

  • Supporter
  • ****
  • Posts: 1411
  • Country: lt
Re: If you ever wondered how hardware RNGs work...
« Reply #8 on: June 10, 2017, 05:23:30 pm »
Even lava lamp based random number generators exist.

Why Car Companies Are Hiring Computer Security Experts, NY Times
Quote

The cybersecurity experts Marc Rogers, left, of CloudFlare and Kevin Mahaffey of Lookout were able to control various Tesla functions from their physically connected laptop. They pose in CloudFlare’s lobby in front of Lava Lamps used to generate numbers for encryption.
« Last Edit: June 10, 2017, 05:25:12 pm by electr_peter »
 

Offline filssavi

  • Frequent Contributor
  • **
  • Posts: 433
Re: If you ever wondered how hardware RNGs work...
« Reply #9 on: June 10, 2017, 06:25:32 pm »
So what else do we have in terms of "simple" schemes for taking and digitizing true randomness that is accessible to DIY tinkering?

Resistor thermal noise.  Ok.  That's easy.

Zener noise.  Ok.  That's easy.

Measuring the noise of decay events of some isotope or similar unpredictable particle flux.  Ok.  That's easy.

I seem to recall one about measuring the noise of pixels in an image sensor or something like that.

I recall other schemes about slowly / asynchronously  sampling the composite values of several uncontrolled free running high frequency oscillators.

Roll dice / flip coins and detect the result of course.

Timestamp photons arriving from a weak (attenuated until the rate is suitably countable)  incandescent source I suppose...?

Something to do with Brownian motion of particles and measuring that maybe?

None 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.

Anyone who truly studied phisycs (quantum mechanics) knows that true randomness exists full well
Among true random effects used today to build HRNG there is:

Radioattive decay
Shot noise of electrons passing a barrier


Then 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 random


If we talk about Coin tosses and dice throws then you have a point
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22408
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: If you ever wondered how hardware RNGs work...
« Reply #10 on: June 10, 2017, 07:07:26 pm »
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 the Logistic 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_function

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7450
  • Country: ca
Re: If you ever wondered how hardware RNGs work...
« Reply #11 on: June 10, 2017, 10:03:56 pm »
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.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22408
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: If you ever wondered how hardware RNGs work...
« Reply #12 on: June 10, 2017, 11:33:00 pm »
Yeah, casinos have a vested interest in making sure their dice are even -- or at least, not against their favor. :P  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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22408
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: If you ever wondered how hardware RNGs work...
« Reply #13 on: June 11, 2017, 12:11:19 am »
Dunno -- I haven't had reason to be concerned about those things. :P

https://en.wikipedia.org/wiki//dev/random says 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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: blueskull

Offline Red Squirrel

  • Super Contributor
  • ***
  • Posts: 2751
  • Country: ca
Re: If you ever wondered how hardware RNGs work...
« Reply #14 on: June 11, 2017, 01:58:54 am »
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.   
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: If you ever wondered how hardware RNGs work...
« Reply #15 on: June 11, 2017, 02:01:50 am »
So they could tune it to faux news broadcast, same randomness, much stronger signal.

Random.org uses an AM radio tuned to static. :)

Tim

Yeah, because *that* wouldn't be hard to hack for anyone within broadcast range of their location.

First 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.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf