Entropy for Random Number Generation

Click For Summary

Discussion Overview

The discussion revolves around generating high-quality random numbers suitable for emulating quantum-level events. Participants explore various methods for entropy generation, including hardware approaches and software solutions, while considering the implications of different random number generators (RNGs).

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Conceptual clarification

Main Points Raised

  • One participant suggests using a Geiger Counter to monitor background radiation as a source of entropy, combined with a high-resolution clock to capture discharge events.
  • Another participant references historical work on entropy pools, specifically mentioning Matt Blaze's "truerand" and its use in systems like Linux's /dev/random.
  • Some participants mention alternative hardware solutions, such as open-source devices like OneRNG, which may not fully align with the original idea but serve the purpose of generating random numbers.
  • There is a discussion about the differences between /dev/random and /dev/urandom, with some participants arguing that /dev/random is not necessary for most applications, while others advocate for its use in certain contexts.
  • One participant expresses skepticism about the quality of both /dev/random and /dev/urandom as PRNGs, citing concerns over their effectiveness and referencing academic papers.
  • Another participant speculates that the original poster may be looking to perform Monte Carlo analysis, although this is uncertain.
  • The original poster clarifies their intent to create a quantum-level emulator, emphasizing the need for a robust RNG to simulate quantum events.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness and appropriateness of /dev/random versus /dev/urandom, with no clear consensus reached. The discussion remains unresolved regarding the best approach to generating random numbers for the intended application.

Contextual Notes

There are limitations in the discussion regarding assumptions about the quality of RNGs and the specific requirements for emulating quantum-level events. Some participants reference external sources and papers that may not be universally accessible or agreed upon.

Who May Find This Useful

This discussion may be of interest to those involved in random number generation, quantum computing simulations, and cryptography, particularly individuals exploring the nuances of entropy sources and RNG implementations.

Boltar
Messages
5
Reaction score
0
I want to generate very random numbers. There's a few approaches to this, such as the audio input from a de-tuned radio, hooking user input such as mouse movement and hashing the results over a period of time etc.. My idea was to get a cheap Geiger Counter and just leave it monitoring background radiation, use this in combination with a nano second resolution clock, each time a discharge event is detected, the least significant few bits of the timer is then used to extend the entropy pool. Left on for long enough and used in combination with other methods. Particularly, I need the numbers to be suitable for emulating quantum level events.
 
Engineering news on Phys.org
I do not know what you are asking for as help exactly, but what you describe derives from something Matt Blaze wrote circa 1995 - truerand. It's descendants are used to populate entropy pools, for example in linux: /dev/random

UNIX C code example:
www.cs.miami.edu/~burt/learning/Math609.../unix_truerand.c
I hope the link works correctly.

Note that a good entropy pool should block on read when exhausted. Most of what you are asking seems really better suited to PF's Electrical Engineering forum.
 
For 40 dollars you can get http://onerng.info/index.html which is open source hardware. It's not exactly what you had in mind but it does the job you had in mind.
On the other hand, one doesn't really need the entropy pool to be full for most cases. Even password generators don't use /dev/random, they use /dev/urandom instead (which never block). Here are some myths about /dev/urandom and /dev/random.
http://www.2uo.de/myths-about-urandom/
 
jim mcnamara said:
@fluidistic
I disagree about /dev/random vs /dev/urandom, plus password generators are not indicative of quality of PRNGs, IMO:
http://ieeexplore.ieee.org/document/1624027/

In fact neither /dev/random nor /dev/urandom is a really good PRNG, but these guys are promoting something else, so take it as it is:
http://dl.acm.org/citation.cfm?id=2516653

Both of these links are behind a paywall ... sorry.
About the disagreement you have between /dev/random and /dev/urandom you mean the former should be used over the latter in most cases? The point of the document is that /dev/random is an overkill most of the time, including for SHA key generation (!). This is also the impression I gather from reading Unix Stack Overflow (for instance https://unix.stackexchange.com/questions/220228/is-it-bad-to-have-a-low-entropy-in-dev-random) and on IRC in both #linux and ##security.

About the papers you menion, one can find both of them in PDF format with google. First one is from 2006 and a huge security patch has been applied in 2012 so I highly doubt what is in the paper is still relevant. The second one has been kind of debugged by the /dev/random maintainer itself at https://news.ycombinator.com/item?id=6548893. I'm not an expert at all in these things but his arguments seems convincing...

Also there's a reason why both /dev/urandom and /dev/random are still used in practice. Note that I'm not saying that /dev/random and /dev/urandom are perfect or can't be improved. But in practice they are more than enough (/dev/urandom might not be enough on some hardware where the entropy is very low on a fresh boot up or so, apparently).

Edit : Another confirmation by an expert : https://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key. I quote:
the only instant where /dev/urandom might imply a security issue due to low entropy is during the first moments of a fresh, automated OS install
so I was wrong to state after a fresh reboot, it is after a fresh install. Probably because the seed is saved before shutting down so that when you reboot the seed cannot be predicted.

Edit 2 : And another one (see the most upvoted answer at https://stackoverflow.com/questions/5635277/is-dev-random-considered-truly-random , I quote
There are many applications which read /dev/random as a kind of ritual, as if it was "better" than /dev/urandom, probably on a karmic level. This is plain wrong, especially when the alea is to be used with classical cryptographic algorithms (e.g. to generate a SSH server public key). Do not do that. Instead, use /dev/urandom and you will live longer and happier. Even for one-time pad.
. Etc.
 
Last edited:
Based on the slightly vague query, I am guessing the OP would need to use /dev/random. It is hard to tell. I assume the OP wants to do some sort of Monte Carlo analysis - again guesswork. Maybe the OP will enlighten us. Then I can stop making a fool of myself...
 
Sorry for the vagueness, I'm basically trying to create a quantum level emulator and give it various scenarios. I'm a complete newbie at all this but I'm pretty sure quantum level events are about as random as you can get, so emulating them would need a decent RNG. I've still got a long way to go (and many more questions to ask) before even 1 line of code is written however. The start scenario will probably be a dual slit experiment emulation. The goal of course being to obtain real world results using the simplest rule set.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 19 ·
Replies
19
Views
5K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K