Alternative Entropy Sources

前端 未结 15 643
情书的邮戳
情书的邮戳 2020-12-11 02:12

Okay, I guess this is entirely subjective and whatnot, but I was thinking about entropy sources for random number generators. It goes that most generators are seeded with th

相关标签:
15条回答
  • 2020-12-11 02:28

    I've used an encryption program that used the users mouse movement to generate random numbers. The only problem was that the program had to pause and ask the user to move the mouse around randomly for a few seconds to work properly which might not always be practical.

    0 讨论(0)
  • 2020-12-11 02:28

    How about spinning off a thread that will manipulate some variable in a tight loop for a fixed amount of time before it is killed. What you end up with will depend on the processor speed, system load, etc... Very hokey, but better than just srand(time(NULL))...

    0 讨论(0)
  • 2020-12-11 02:30

    The Wikipedia article on Hardware random number generator's lists a couple of interesting sources for random numbers using physical properties.

    My favorites:

    • A nuclear decay radiation source detected by a Geiger counter attached to a PC.
    • Photons travelling through a semi-transparent mirror. The mutually exclusive events (reflection — transmission) are detected and associated to "0" or "1" bit values respectively.
    • Thermal noise from a resistor, amplified to provide a random voltage source.
    • Avalanche noise generated from an avalanche diode. (How cool is that?)
    • Atmospheric noise, detected by a radio receiver attached to a PC

    The problems section of the Wikipedia article also describes the fragility of a lot of these sources/sensors. Sensors almost always produce decreasingly random numbers as they age/degrade. These physical sources should be constantly checked by statistical tests which can analyze the generated data, ensuring the instruments haven't broken silently.

    0 讨论(0)
  • 2020-12-11 02:30

    I found HotBits several years ago - the numbers are generated from radioactive decay, genuinely random numbers.

    There are limits on how many numbers you can download a day, but it has always amused me to use these as really, really random seeds for RNG.

    0 讨论(0)
  • 2020-12-11 02:32

    Modern RNGs are both checked against correlations in nearby seeds and run several hundred iterations after the seeding. So, the unfortunately boring but true answer is that it really doesn't matter very much.

    Generally speaking, using random physical processes have to be checked that they conform to a uniform distribution and are otherwise detrended.

    In my opinion, it's often better to use a very well understood pseudo-random number generator.

    0 讨论(0)
  • 2020-12-11 02:32

    Some use keyboard input (timeouts between keystrokes), I heard of I think in a novel that radio static reception can be used - but of course that requires other hardware and software...

    0 讨论(0)
提交回复
热议问题