Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60829 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97534 invoked from network); 14 Jun 2012 14:50:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2012 14:50:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qc0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:45687] helo=mail-qc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/69-39100-42AF9DF4 for ; Thu, 14 Jun 2012 10:50:12 -0400 Received: by qcmt36 with SMTP id t36so1156790qcm.29 for ; Thu, 14 Jun 2012 07:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zd41FZysjHsah97gpiBH6HdNGIH3kTZtZDYWn1VnDU0=; b=qTh5v1yChjNNWZuUlC/BgonmibPNbwTmPvA4POnFHAb7L3ZpfMYt6lvPU4iN/R+vEr ToskbyL7CV6W1aq/zRpeCXA3wxRtuAk2n74iN2Ox7aeI7lSFt8dgs2c2jSWYMbmxuit4 1VSLXBeysA0S13o9MIkOuhhuoc0kw9sPstqkjw9OTAXPzv8SjYItlZ4LxOVysDxIeUAm jk4H24eqjaaxr3kavgGLBrO/VpixFed59zgE1Qp54axqYySRIjTsx4/v0GHzWquzoswK 1q1FiYeyQNuFWSQMMZaHpfBEQiPYnEGTjB2I5vgzB528WaPHRqb4rgR3EZX87QzlY6yN R1GA== MIME-Version: 1.0 Received: by 10.224.221.141 with SMTP id ic13mr4891001qab.2.1339685409112; Thu, 14 Jun 2012 07:50:09 -0700 (PDT) Received: by 10.229.49.204 with HTTP; Thu, 14 Jun 2012 07:50:09 -0700 (PDT) In-Reply-To: <4FD9F30F.5060304@cubiclesoft.com> References: <4FD9F30F.5060304@cubiclesoft.com> Date: Thu, 14 Jun 2012 10:50:09 -0400 Message-ID: To: Thomas Hruska Cc: PHP Development Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Adding a simple API for secure password hashing? From: ircmaxell@gmail.com (Anthony Ferrara) Thomas, > This: > > http://barebonescms.com/documentation/csprng/ > > Takes a different approach. =A0Generate one or more stored root seeds and= then > use those seeds to generate as much data as is needed without risking los= s > of entropy. =A0It also accepts extra entropy sources as input - even weak > sources such as an incrementing integer or serialized user-submitted data= - > to further enhance the output. Actually, I would not call that CS. Where's the white paper for the algorithm? Where's the RFC? Just because you take data from a lot of sources does not make it CS... And just putting the *kitchen sink* into a single sha512 hash does not either. The vast majority of the data that's being called entropy is purely static on the system (page to page won't change). Especially for something that's going into core, I'd suggest sticking to approved, vetted algorithms. If it doesn't have an RFC or a reviewed white-paper, I would avoid it. Additionally, it's pushing all of the "entropy sources" into a single hash bucket. I'd much rather see it push each one through a hmac round with the existing data. That way, the relationship between a specific source and the overall result is complex. It's not just complex in relation to other data, but also into the algorithm itself... > Adding more random sources of information to PHP is a good thing. =A0If > something like what is being discussed is developed, it will merely becom= e > one more source for root seed generation. =A0The more the merrier. =A0Goo= d > sources of entropy are hard to come by. Definitely agree... > One thing I would like to recommend is add to the documentation that cert= ain > functions are inappropriate for specific use cases and recommend alternat= ive > solutions. =A0A lot of people out there think rand() and mt_rand() are > suitable for security. =A0Maybe have a specific page in the PHP documenta= tion > dedicated to covering random string and number generation and link to tha= t > page from various function pages. Sounds good to me... Anthony