Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60831 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15604 invoked from network); 14 Jun 2012 15:50:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2012 15:50:50 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-ee0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:40032] helo=mail-ee0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/EC-39100-9580ADF4 for ; Thu, 14 Jun 2012 11:50:49 -0400 Received: by eekb57 with SMTP id b57so645237eek.29 for ; Thu, 14 Jun 2012 08:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=COYLeaOxH89rrrRwKfJScGfoUnbO9MLJdw6CtOjY1Tw=; b=jCVGjm/Zhd63xRYX/H8m8hZHp+u1OPObZ4Yf7COm39idP7AMfiZDnFXNhMCwNjSia9 hA5+eWEq+BUg+xUUcrJXWcPef31VX48p2Cu7ju3cw4MpAUyLqc6cquLgTT5cQPKttLMn 9uAtpLIOETY3FDTcDu5RdBxYTRqc3B+TOk0Ry0W0xGwXuC7Hei0Jc/4XXllkDDdib9va QFAp1q0uFpzhqSCFuo3fFZy4zznRXqisrhZ6//iqieKzmdmExF7UjVwkLsGTl6HTon21 2Y0kWzTIo3izgj9bLT6K2BL5qgQqRtTw1sh1lUeB58tFfMd7P3FxrM7Eavvlm7lYifTx oqHw== Received: by 10.14.96.142 with SMTP id r14mr695839eef.46.1339689046761; Thu, 14 Jun 2012 08:50:46 -0700 (PDT) Received: from [192.168.1.26] (155.Red-88-13-201.dynamicIP.rima-tde.net. [88.13.201.155]) by mx.google.com with ESMTPS id g46sm20715641eea.14.2012.06.14.08.50.44 (version=SSLv3 cipher=OTHER); Thu, 14 Jun 2012 08:50:46 -0700 (PDT) Message-ID: <4FDA083F.6070602@gmail.com> Date: Thu, 14 Jun 2012 17:50:23 +0200 User-Agent: Thunderbird MIME-Version: 1.0 To: Peter Lind CC: Anthony Ferrara , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Adding a simple API for secure password hashing? From: keisial@gmail.com (=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=) On 14/06/12 16:26, Peter Lind wrote: > I would say it really depends upon the project. The salt can not only > protect against rainbow tables and password hash collisions, if it is > unknown to an attacker then it essentially acts to further strengthen > the hash by vastly expanding the keyspace. Supposing an attacker is > trying to get at the password for just one user account (say, admin) > and the hashed password is available - if the salt can be > predicted/guessed, then the keyspace is reduced to that of an unsalted > password and you can run a dictionary attack on the hash. If, on the > other hand, the salt is unpredictable and you don't have access to it, > there is no way to run a dictionary attack (offline, that is). The > security here depends upon storage as well, but the point remains - a > salt isn't by default something you can make public knowledge. > > It might be a theoretical concern for most people and the people > really wanting the extra level of security would probably know well > enough how to get exactly what they need - but if provisions are made > so you could reuse the same function you might also be able to educate > developers better. I.e. make it easy to do the right thing and more > people will do it. May I ask how would you end up at the situation where the attackers have the password hashes but not the salt? Any process which needs to read the password hashes will also need knowledge of the salt. Thus an attacker would most likely also know both. That's precisely how salts are designed to work. I admit you could have a common salt for all users stored in php and only a leak of the database. But such salt would most likely be provided by the user, generated using a different program... expected to be secure. Using a shared salt is worse than a uniqe salt per user, so that's not something to promote either. You wouldn't be "educating in the right way".