5 ms·
Agreed. /dev/urandom should be mixed with other sources of entropy (system statistics, epoch, low-level counters, cryptographic PRNGs like Yarrow) and then "co
by asymptotic 16y ago
Agreed. /dev/urandom should be mixed with other sources of entropy (system statistics, epoch, low-level counters, cryptographic PRNGs like Yarrow) and then "combined" using a cryptographic hash. Such a principle is used in e.g. Fortuna.
See:
https://secure.wikimedia.org/wikipedia/en/wiki/Fortuna_%28PRNG%29 https://secure.wikimedia.org/wikipedia/en/wiki/Fortuna_%28PR...
- jojo1 16y agoOr just use /dev/random :)
- getsat 16y agoReads from /dev/random will block when the entropy pool is empty. You can see the number of bits of entropy available on a Linux systems via: $ cat /proc/sys/kernel/random/entropy_avail If you need more, better randomness, check out the Entropy Key: http://www.entropykey.co.uk/ http://www.entropykey.co.uk/
- chalst 16y agoBlocking /dev/random when entropy is low is the correct behaviour, but it is a system-dependent behaviour. Darwin (Mac OSX) has the two sources behave identically. The Darwin man page justifies this behaviour saying: /dev/urandom is a compatibility nod to Linux. On Linux, /dev/urandom will produce lower quality output if the entropy pool drains, while /dev/random will prefer to block and wait for additional entropy to be collected. With Yarrow, this choice and distinction is not necessary, and the two devices behave identically. You may use either. and then contradicts itself later by saying: Yarrow is a fairly resilient algorithm, and is believed to be resistant to non-root. The quality of its output is however dependent on regular addition of appropriate entropy.
- deleted 16y ago[deleted]
- dchest 16y ago/dev/urandom should be mixed with other sources of entropy (system statistics, epoch, low-level counters, cryptographic PRNGs like Yarrow) It's already cryptographically secure PRNG, and already mixes sources that you mentioned, same as /dev/random (except on Linux /dev/random blocks when there's not enough entropy, and urandom doesn't).