Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72395 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52214 invoked from network); 8 Feb 2014 04:48:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2014 04:48:56 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:62924] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/47-03933-637B5F25 for ; Fri, 07 Feb 2014 23:48:55 -0500 Received: by mail-la0-f53.google.com with SMTP id e16so3239224lan.26 for ; Fri, 07 Feb 2014 20:48:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=d9KfeHmzvziyP3erpLaiVWeoSbLATKp/8y9OzNB5eSQ=; b=nN/t480/odfRjtixkhLUIEugNUWuGvYrgtQWHa040iyY3PAMwuvcJBVb3Alu4o6QSw nke7D11cqL7yI1hUWBCHiue0ulWFHSd85QTUJooAKYxyjyIOiumg5mbvuczW9znoXefk JW2O1SlsMl+Z83Ef52yQOlfXjxpyI8GItkyZlUtKBWqGFSx+WwQzz46vvYAh6P968+/p pQ+kjBx9K7oBorxA/rLoYA9hhiKTMlc+dUq+L2T4x2yt7/1acgsO7PhO1gSt0uqsmYZs wJOJ/Sg1AIhVDgPkUXAj2TveUJTIdHGudSeMXeq5Dtdu2ZGCku8dqOCATCKtSjyx5Qlf wLEg== X-Received: by 10.153.3.2 with SMTP id bs2mr12347294lad.5.1391834931814; Fri, 07 Feb 2014 20:48:51 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Fri, 7 Feb 2014 20:48:11 -0800 (PST) In-Reply-To: References: Date: Sat, 8 Feb 2014 13:48:11 +0900 X-Google-Sender-Auth: FkKP47uEeuHDwe_TBt8j2TbKUbM Message-ID: To: Pierre Joye Cc: PHP internals Content-Type: multipart/alternative; boundary=001a1136c742b2668504f1ddd2c9 Subject: Re: [PHP-DEV] unify entropy source for all php related functions From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1136c742b2668504f1ddd2c9 Content-Type: text/plain; charset=UTF-8 Hi Pierre, On Fri, Feb 7, 2014 at 8:25 PM, Pierre Joye wrote: > There are a lot of additions and discussions about entropy source and > (P)RNG lately. > > PHP already has a ini setting to define a strong entropy source for > the session module, which defaults to urandom or arandom. > > I would like to create two settings to unify the entropy source > accross php functions. That includes mcrypt, new password APIs, > session, LCG, etc. > > Something along this line: > > random.entropy_strong_source (/dev/(u|a)random etc.) > random.entropy_crypto_source (/dev/random etc.) > +1 for unify. BTW, it sound more natural if names are random.entropy_crypto_source (/dev/(u|a)random etc.) random.entropy_strong_source (/dev/random etc.) I feels like 'strong' > 'crypto' with this naming. > I am not willing to propose new RNG functions or extensions for 5.6 as > we have way too little time to actually discuss its design and APIs. > However having these settings unified and documented would be a good > step forward already. > Although, I really would like to have one, it's not much issue for me, but a issue for average users ;) This is possible implementation. https://github.com/yohgaki/php-src/compare/PHP-5.6-rfc-random_bytes It's not perfect yet, though. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1136c742b2668504f1ddd2c9--