lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hash: SHA1

On 17/01/10 13:06, Rob Kendrick wrote:
> On Sun, 17 Jan 2010 12:55:56 +0000
> startx <> wrote:
>> i assume by "unsafe" you mean "unreliable", meaning that if there is
>> not enought entropy it will block? thats the nature of /dev/random ,
>> if you want non-blocking entropy /dev/urandom is what you need.
> No, it won't block.  It's PRNG that is occasionally reseeded by people
> writing to it.

For clarity:

On Linux, /dev/random will return truly random values from the entropy
pool. If the entropy pool is empty, it *will* block.

/dev/urandom is a variant of /dev/random that, when the entropy pool is
empty, will return fake random numbers generated with a PRNG. As such it
is not suitable for crypto purposes.

By default, Linux's entropy pool size is 4096 bits. Processes will only
get woken up when at least 64 bits of entropy are available. There's a
warning in the documentation that /dev/random is suitable for reading
very small quantities of data only, such as crypto key seeds (not crypto
keys themselves!), and that unless you really know what you're doing
/dev/urandom is almost certainly the one you want.

(From random(4).)

- -- 
┌─── ───── ─────
│ "Under communism, man exploits man. Under capitalism, it's just the
│ opposite." --- John Kenneth Galbrith
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -