Re: [RFC] [DISCUSSION] Reliable user-land CSPRNG

From: Date: Tue, 24 Feb 2015 11:08:45 +0000
Subject: Re: [RFC] [DISCUSSION] Reliable user-land CSPRNG
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-83653@lists.php.net to get a copy of this message
On 24 February 2015 at 10:55, Pierre Joye <pierre.php@gmail.com> wrote: > It should use the session.entropy_file setting as it aims to be the exact > same thing. It also allows custom entropy src (better ones for higher > demands) as well. I disagree. We want to take responsibility away from the user to choose the best source of entropy. The session.entropy_file setting also does not allow arc4random to be used, which is a source of cryptographic quality random without using a file descriptor. In fact I had planned for a future RFC where we allow session.entropy_file to use using random_bytes(). So the "best" source is chosen automatically. (If you think there are better sources not covered by this patch, please let me know, I would like it to be complete) There is an aspect of this that has been left for "future work", but if the list thinks it is important I can implement it for this RFC. The issue is that on Linux it still does not provide a way of getting random bytes without using a file descriptor. This is important for a couple of reasons, 1) It means chroot environments don't require /dev/*random 2) it prevents fd-exhaustion attacks that force lower quality randomness. LibreSSL-portable has a very good implementation of this using the Linux getrandom syscall (Kernel >= 3.17) that I can phpise and include if we think it is necessary.

« previous php.internals (#83653) next »