[cryptography] Kernel space vs userspace RNG

Tony Arcieri bascule at gmail.com
Thu May 5 23:04:38 EDT 2016


On Thu, May 5, 2016 at 2:40 AM, shawn wilson <ag4ve.us at gmail.com> wrote:

> I wonder what the gain is for putting RNGs in the kernel.
>
A naive userspace RNG will duplicate its internal state when you fork,
which can be catastrophic in a cryptographic context. That's a problem that
can be fixed by configuring a proper pthread_atfork() (or thereabouts)
callback to reseed a userspace RNG when a process forks, but illustrative
of the sorts of sharp edges that can occur with userspace RNGs.

If performance is important, properly implemented userspace RNGs can be
helpful, but they're easy to screw up.

-- 
Tony Arcieri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/cryptography/attachments/20160505/f41c0396/attachment.html>


More information about the cryptography mailing list