#47952 [Opn->WFx]: Access to OS randomness would be nice
| From: | scottmac@php.net | Date: | Sat, 11 Apr 2009 19:12:57 +0000 |
| Subject: | #47952 [Opn->WFx]: Access to OS randomness would be nice | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-135745@lists.php.net to get a copy of this message | ||
ID: 47952
Updated by: scottmac@php.net
Reported By: jking at jkingweb dot ca
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
PHP Version: 5.2.9
New Comment:
It's not in the manual yet but you'll find
openssl_random_pseudo_bytes() in PHP 5.3 that accesses the underlying
PRNG.
We could add this to PHP itself, but I think letting OpenSSL being
responsible for this is better in case we make a mistake.
Previous Comments:
------------------------------------------------------------------------
[2009-04-11 18:52:45] jking at jkingweb dot ca
Description:
------------
The other day I wrote a PHP implementation of a spec which mandates
using a cryptographically-secure random number generator. For most Unix
systems this is easy (/dev/urandom or /dev/random), but getting access
to such a source in PHP for Windows seems impossible.
I thought it might be beneficial for PHP to expose the best source of
randomness availble via fopen("php://random") or some such. I confess I
don't know how difficult this would be to do, but it would certainly be
more feasible for PHP itself to pull this off in a cross-platform
fashion than for little old me writing software from within PHP.
Reproduce code:
---------------
---
From manual page: wrappers.php
---
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47952&edit=1