4 ms·
Two reasons. (1) The kernel itself needs access to good random numbers for its operation. (2) Having a source of random number is something many applications
by JoachimS 5y ago
Two reasons.
(1) The kernel itself needs access to good random numbers for its operation.
(2) Having a source of random number is something many applications need, and just like other services (storage, communication) random numbers a good thing to provide.
As the article shows, generating good random numbers generated based on physical entropy is a complex process. Not providing this as a service to applications would probably lead to many applications having bad random numbers. Just like we don't expect all applications to implement their own version of TCP.
Note that applications may use PRNGs from a library, for example Clib. But unless you want just pseudo randomness you somehow need to get entropy/noise from the physical machine. And the service presented to the application (for example via /dev/random) provides that.
- JoachimS 5y agoThough of course, this could be in a userland library too. Just reading entropy from HW (exposed by the kernel). But the kernel still needs access to random number it can control and trust.