This manual page says:
Note: As of PHP 5.4.0 session.entropy_file defaults to
/dev/urandom
or/dev/arandom
if it is available. In PHP 5.3.0 this directive is left empty by default.
So, what's /dev/arandom
and how does it differ from /dev/[u]random
?
The /dev/random and /dev/urandom files are special files that are a source for random bytes generated by the kernel random number generator device. The /dev/random and /dev/urandom files are suitable for applications requiring high quality random numbers for cryptographic purposes.
The character special files /dev/random and /dev/urandom (present since Linux 1.3. 30) provide an interface to the kernel's random number generator. The file /dev/random has major device number 1 and minor device number 8. The file /dev/urandom has major device number 1 and minor device number 9.
'Urandom' is used where there is constant need of random numbers and its randomness is not much important while 'random' is used where there is a security concern and its randomness should be reliable as it blocks outputting random numbers if entropy is not up to the mark.
The /dev/urandom device provides a reliable source of random output, however the output will not be generated from an equal amount of random input if insufficient input is available. Reads from the /dev/urandom device always return the quantity of output requested without blocking.
From here. It appears as though arandom
will guarantee that sufficient entropy is present before returning the amount of data requested. It also appears to be limited to OpenBSD implementations. urandom
will return the amount of data requested no matter whether there is enough entropy -- which obviously could introduce a vulnerability if there is not enough.
This page does a reasonable job explaining what the device is:
As required, entropy pool data re-seeds an ARC4 generator, which then generates high-quality pseudo-random output data.
More information about the underlying technique is available from Wikipedia.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With