Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75739 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30577 invoked from network); 21 Jul 2014 06:17:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2014 06:17:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-la0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:49485] helo=mail-la0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/7C-48607-980BCC35 for ; Mon, 21 Jul 2014 02:17:45 -0400 Received: by mail-la0-f42.google.com with SMTP id pv20so3991475lab.29 for ; Sun, 20 Jul 2014 23:17:41 -0700 (PDT) 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=/2jOvJztTX3eA0bTZ6No7CXGOVFvXamFRYC4K5Ci7Ts=; b=Gnc0B0HYydh3wL4bhRsTjg9ELwSLWhzzZp7RofhN2IVlT2qEitka0EO67msNSd2niS EmXWV788ZEgXQkbJA2UagWbhXDpiNcVcoQqhjYq2wot4d8m3zmftPDeOzdBiR0Sdh8w2 1XZFT8mYrnh7S+u5CL/lU8TCyZ6NLc1yhnbKBzyVqUpzpVf78Da+s1ME9C8ZcOmLrk/i WYNXddFQOvBbhZ4adwl/5ubsgZ3ztCtBgq+jhWIUtAPQ9SvKWyfeQnFwrjHat+LxSROG zhc+dedTVK+Hxadl9f+JrHiH7ZXZ5Aqo8W74N8mQkDwHQN8HSPUhUykwX/yIFKEhnIlI mT1w== X-Received: by 10.112.106.67 with SMTP id gs3mr7883257lbb.84.1405923461625; Sun, 20 Jul 2014 23:17:41 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.128.202 with HTTP; Sun, 20 Jul 2014 23:17:01 -0700 (PDT) In-Reply-To: References: Date: Mon, 21 Jul 2014 15:17:01 +0900 X-Google-Sender-Auth: vL1o0Jd1gyKG_qZgwZltGtOCJwE Message-ID: To: David Muir Cc: Anthony Ferrara , Adam Harvey , Tjerk Meesters , Sara Golemon , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1135f31682ffc204feae1021 Subject: Re: [PHP-DEV] crypt() BC issue From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1135f31682ffc204feae1021 Content-Type: text/plain; charset=UTF-8 Hi David, On Mon, Jul 21, 2014 at 2:53 PM, David Muir wrote: > Prehashing with sha512 means it is no longer blowfish. It is now a > non-vetted DIY algorithm. The whole point of password_hash is to avoid this > type of thing, and should be clearly discouraged in the documentation. > I agree. It's far better if it could handle limitless password length. The problem is "there is no way to achieve this with current implementation". It's a classic example of what not to do. > I agree here, too. We are better to have algorithm that does not enforce user/developer to certain password and recommend "Just use it". However, Using multiple hashes for better security is common technique. An example is SSL. So I would not say one should not. Especially when there is a limitation. In old days, crypt() was unusable securely. There are many users/developers that are used to have static slat. Code like below disables authentication completely. password_hash(hash('sha512', SOME_SECRET_SALT).$password, DEFAULT); This should be prevented. (I would like to prevent it by raising E_NOTICE error) If we would like to recommend "Just use it", we may consider adding SHA512 to password_hash(). Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1135f31682ffc204feae1021--