2 ms·
Another good source explanation of the difference between urand and rand is the Linux source code, which is well commented: https://github.com/torvalds/linux/b
by nly 13y ago
Another good source explanation of the difference between urand and rand is the Linux source code, which is well commented:
https://github.com/torvalds/linux/blob/master/drivers/char/random.c https://github.com/torvalds/linux/blob/master/drivers/char/r...
The operation is explained starting on line 52. The 2 paragraphs starting on line 78 explain the relationship behind the entropy estimator and the CSPRNG (It relies on SHA-1).
> As more and more random bytes are requested [from /dev/urandom] without giving time for the entropy pool to recharge, this will result in random numbers that are merely cryptographically strong
- danieldk 13y agoThank you! That was actually much clearer. Line 307 is also relevant - it seems that the urandom pool is reseeded at most every 60 seconds? https://github.com/torvalds/linux/blob/master/drivers/char/random.c#L307 https://github.com/torvalds/linux/blob/master/drivers/char/r...