[ltp] random number generator

U Kuehn linux-thinkpad@linux-thinkpad.org
Thu, 22 Feb 2007 20:14:36 +0100


James Knott wrote:
>
> I don't know about that, but one method for generating a reasonably
> random number is to use "ps aux|md5sum".
> This will create a 128 bit number that is determined by the recent state
> of all your processes, which changes constantly.
> 
Unfortunately, this method is not nearly as secure as you might think.
Just consider how much entropy you have if you do this, say, 10 times a
second. Many of the changes are rather predictable.

To cite Knuth (from memory): When generating random numbers, do not use
a method at random.

Regards,
Ulrich