Re: /dev/random not generating random data

From: Unruh (unruh-spam_at_physics.ubc.ca)
Date: 05/24/05


Date: 24 May 2005 16:23:06 GMT

Mihai Osian <zzz@zzz.com> writes:

> Before looking further you should decide if the random() function from
>stdlib is not good enough for whatever purpose you have. Look for

The random function is crytographically a joke. It is good formonte-Carlo
simulations or other simulations in which what you want is some flat
distribution of outcomes which jump around, but for cryptographic purposes
it should not be used. Ie, with very few outputs you can determine the
initial seed and predict all future outputs.It has the advantage for
simulations of giving the same output for the same seed, and thus you can
rerun a simulation exactly.
 
/dev/urandom however is a cryptographically strong random number generator
It is continually reseeded with physically random sources.
There is no known way of predicting future output, no matter how long a
stream of output you have. It is however much slower than random() so if
you are carrying out a simulation with 10^10 runs, urandom is NOT the thing
to use.

>example at the small program below - you will see that it produces a
>flat distribution within 1-2%. For my usage (statistical computations)
>is good enough. For cryptography it is a different story.

> Just to give you another direction to look - some motherboards (even
>CPUs) have a hardware random number generator which uses thermal noise.
>Read this: http://www.ibiblio.org/peanut/Kernel-2.6.10/hw_random.txt . I
>have zero experience with this stuff, so I can't tell you more.

Yes, that is another route. I do not know if /dev/random and /dev/urandom
writers are planning on including such generators in their list of physical
sources. Again they will be slow, and the software using them
will have to be carefully constructed to remove the biases present in any
physical source of randomness.



Relevant Pages

  • Re: Evolution increases the computational ability of organisms.
    ... >> purpose". ... be good evidence favouring the simulation hypothesis. ... > created are simulations within our own universe - ... What part of "understandings gained from simulations ...
    (talk.origins)
  • Re: Matlabs random number generator is suspicious... what to do?
    ... results, and did not bother to reinitialize the random number generator, you ... Just because MATLAB by default ... Carlo simulations perform. ... The cause of this as of yet unknown problem has to ...
    (comp.soft-sys.matlab)
  • RE: SHA-based subclass for random module
    ... other simulations may not care at all. ... If you're only using one PRNG, ... Pass your base generator to the Shuffle constructor, ...
    (comp.lang.python)
  • Re: need a good implementation of pseudorandom generators
    ... to perform a large number of simulations for it and require a good ... pseudorandom generator for it. ... I am currently using a suimple implementation based on randfunction. ... that depends on the nature of the built-in rand function. ...
    (sci.stat.math)
  • Re: Computer simulations of population genetics --
    ... I Googled "site:citeseer.ist.psu.edu population genetics simulation" ... simulations of population genetics. ... Can you make explicit your purpose? ... 'best' pop-gen simulations suited to doing research -- identify the ...
    (sci.bio.evolution)