<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 17:35:12 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Mike Dalisay: Salt, Hash and Store Passwords Securely with Phpass]]></title>
      <guid>http://www.phpdeveloper.org/news/19427</guid>
      <link>http://www.phpdeveloper.org/news/19427</link>
      <description><![CDATA[<p>
On <i>Mike Dalisay</i>'s site there's a recent post showing how to use the <a href="http://www.openwall.com/phpass/">Phpass</a> tool to <a href="http://www.codeofaninja.com/2013/03/php-hash-password.html#.UVziYKUm0sc.dzone">salt, hash and store passowrd data</a> in your application.
</p>
<blockquote>
I think the main reason why we have to hash passwords is to prevent passwords from being stolen or compromised. You see, even if someone steal your database, they will never read your actual or cleartext password. I know that some PHP frameworks or CMS already provide this functionality, but I believe that it is important for us to know how its implementation can be made.
</blockquote>
<p>
His <a href="https://docs.google.com/file/d/0B-AInNrVeucKZGgzWThFdUNhNVk/edit?usp=sharing">sample application</a> stores the user data in a MySQL database and does the salting+hashing at the time of the request. It uses a hard-coded salt and a value of 8 for the hashing/stretching.  Screenshots of each page in the example application are also included.
</p>
Link: http://www.codeofaninja.com/2013/03/php-hash-password.html#.UVziYKUm0sc.dzone]]></description>
      <pubDate>Mon, 08 Apr 2013 12:16:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrew Podner: PHP 5.5 Preview: New Password Hashing API]]></title>
      <guid>http://www.phpdeveloper.org/news/19360</guid>
      <link>http://www.phpdeveloper.org/news/19360</link>
      <description><![CDATA[<p>
<i>Andrew Podner</i> has posted about the <a href="http://unassumingphp.com/php-5-5-preview-new-password-hashing-api/">password hashing functionality</a> that's coming with PHP 5.5 - how it will work and some of the benefits of its use.
</p>
<blockquote>
Recently PHP 5.5 was released into beta, which puts us one step closer to another release of PHP.  This week, I thought I would spend a little time explaining a new feature that will be implemented in 5.5 that will hopefully make dealing with passwords easier for developers to grasp and properly implement.  I cannot tell you the number of apps, even ones written within the last year or so, that I open up only to find either an md5 hash, or worse, clear text password storage.  I keep telling myself that eventually this will come to an end, and people will stop taking the easy way out.  Maybe PHP 5.5 will have made it so easy that there is simply no further excuse not to implement solid password hashing.
</blockquote>
<p>
He includes an example of the four new functions that will come with the hashing functionality: password_get_info, password_hash, password_needs_rehash and password_verify. He includes the parameters that should be included in each call and the details from the call to get the hash's info. If you're not going to be able to move up to PHP 5.5 when it's released, you might consider looking into <a href="https://github.com/ircmaxell/password_compat">this compatibility library</a> to have a similar interface and functionality (for 5.3.7 or greater).
</p>]]></description>
      <pubDate>Mon, 25 Mar 2013 12:32:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Password Hashing In PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19031</guid>
      <link>http://www.phpdeveloper.org/news/19031</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial that wants to help you keep your application and users a bit safer - a <a href="http://phpmaster.com/password-hashing-in-php/">guide to password hashing</a> for PHP applications.
</p>
<blockquote>
You must always think about security. If passwords are stored in plain text, what happens if an attacker gains access to your database? He can easily read all of the users' passwords. That's why we use a technique called password hashing to prevent attackers from getting user passwords. In this article you'll learn how to store the passwords securely in the database so that, even if your database falls into wrong hands, no damage will be done.
</blockquote>
<p>
He starts off describing what password hashing is and why it's important (and better than it's plain-text alternative). He gives some examples of using some of the built-in hashing functions PHP has to offer to generate the hashes. He starts with <a href="http://php.net/md5">md5</a>/<a href="http://php.net/sha1">sha1</a> (note, these are <b>not recommended</b>) but moves into more effective options like sha256, salted hashing and even bcrypting passwords with <a href="http://php.net/crypt">crypt</a>.
</p>
<p>
Be sure to check out the comments for other security concerns and links to suggested tools and resources.
</p>]]></description>
      <pubDate>Mon, 14 Jan 2013 11:57:32 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara: Designing An API: Simplified Password Hashing]]></title>
      <guid>http://www.phpdeveloper.org/news/18768</guid>
      <link>http://www.phpdeveloper.org/news/18768</link>
      <description><![CDATA[<p>
A while back <i>Anthony Ferrara</i> proposed a standardized password hashing feature to be included into the core of PHP. It was <a href="https://wiki.php.net/rfc/password_hash">voted on</a> and it was decided it would be introduced in the PHP 5.5 releases. <i>Anthony</i> has <a href="http://blog.ircmaxell.com/2012/11/designing-api-simplified-password.html">written up a new post</a> talking some about his process in making this upcoming feature and answering some of the most common questions he's gotten about it.
</p>
<blockquote>
The other day, <a href="http://www.php.net/archive/2012.php#id2012-11-15-1">PHP 5.5 Alpha 1</a> was released to the public for the first round of testing the new features that are coming out. One of those new features is the <a href="https://wiki.php.net/rfc/password_hash">Simplified Password Hashing API</a> that I proposed (and was accepted). I have received a lot of feedback and criticism of the new API in the months since it's been committed. I figured now that Alpha 1 is out and people can play with it, I should respond to some of those items, and give a little bit more insight into why it was built the way it was...
</blockquote>
<p>
He talks about some of his goals with the use of the functionality (simplicity, something "the 99%" can use) ans answers questions about:
</p>
<ul>
<li>Why the functions aren't namespaced
<li>Why it's not just a class that can be included when needed
<li>The choice of not going with an OOP interface
<li>Why PBKDF2 and Crypt-SHA-512 aren't supported
</ul>
<p>
...and several other questions, but you'll have to <a href="http://blog.ircmaxell.com/2012/11/designing-api-simplified-password.html">read the full post</a> for the rest of those. You can find out a lot about the API for this functionality from <a href="https://wiki.php.net/rfc/password_hash">its wiki page</a> and, if you'd like to try it out (in an alpha state), you can <a href="http://www.php.net/archive/2012.php#id2012-11-15-1">download this version of PHP</a> and compile it yourself.
</p>]]></description>
      <pubDate>Mon, 19 Nov 2012 12:42:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: Login Security (Best Practices Recommendations)]]></title>
      <guid>http://www.phpdeveloper.org/news/18359</guid>
      <link>http://www.phpdeveloper.org/news/18359</link>
      <description><![CDATA[<p>
On Reddit.com there's a good conversation going on in the PHP category about <a href="http://www.reddit.com/r/PHP/comments/y4wuc/login_security/">login security</a> and best practices surrounding it.
</p>
<blockquote>
So I was handed an ancient project which was up to me to fix / improve. About a week later I am about done but there is 1 thing I left...Login security. As it is now, it's just md5(password) that's saved in the database. Better then nothing, but far from good enough. My plan was to have a constant pepper in the class which handles the logins, then do something like crypt(pepper . $password) to store it, since that should generate a random salt and is slower then sha1 / md5 / etc. I feel this should be save enough, do any of you have any ideas on how to improve it (without non-standard extensions)?
</blockquote>
<p>
There's lots of <a href="http://www.reddit.com/r/PHP/comments/y4wuc/login_security/#comments">comments</a> so far and a lot of them are following along the same lines - use a better method of encryption, something like <a href="http://php.net/manual/en/function.crypt.php">crypt</a> with Blowfish or something similar as well as some hashing (like <a href="http://php.net/manual/en/function.hash-hmac.php">HMAC</a>). 
</p>]]></description>
      <pubDate>Tue, 14 Aug 2012 12:20:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Oscar Merida's Blog: Using bcrypt to store passwords]]></title>
      <guid>http://www.phpdeveloper.org/news/18100</guid>
      <link>http://www.phpdeveloper.org/news/18100</link>
      <description><![CDATA[<i>Oscar Merida</i> has a recent post to his blog about <a href="http://oscarm.org/2012/6/using-bcrypt-store-passwords">using the bcrypt functionality</a> to more securely store the password information for your application's users.
</p>
<blockquote>
<p>
The linkedin password breach highlighted once again the risks associated with storing user passwords. I hope you are not still storing passwords in the clear and are using a one-way salted hash before storing them. But, the algorithm you choose to use is also important. [...] The choice, at the moment, seems to come down to SHA512 versus <a href="http://en.wikipedia.org/wiki/Bcrypt">Bcrypt</a> encryption.
</p>
<p>
[...] I wanted to switch one of my personal apps to use bcrypt, which on php means using Blowfish encryption via the crypt() function. There's no shortage of classes and examples for using bcrypts to hash a string. But I didn't find anything that outlined how to setup a database table to store usernames and passwords, salt and store passwords, and then verify a login request.
</p>
</blockquote>
<p>
He shows you how to set up a simple "users" table and the code for a "save_user" method that takes in the username/password and generates a salt and calls <a href="http://php.net/crypt">crypt</a> on it with the Blowfish prefix on the string ($2a$). His login check function ("validate_user") then takes the user's input, does the same hashing and checks the result.
</p>]]></description>
      <pubDate>Fri, 15 Jun 2012 10:52:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara's Blog: Properly Salting Passwords, The Case Against Pepper ]]></title>
      <guid>http://www.phpdeveloper.org/news/17832</guid>
      <link>http://www.phpdeveloper.org/news/17832</link>
      <description><![CDATA[<p>
In <a href="http://blog.ircmaxell.com/2012/04/properly-salting-passwords-case-against.html">this new post</a> to his blog <i>Anthony Ferrara</i> looks at a common idea that comes up when the discussion of encryption of passwords in PHP - the global salt (or "pepper").
</p>
<blockquote>
The other day I <a href="http://blog.ircmaxell.com/2012/04/introducing-passwordlib.html">announced the release</a> of my new password hashing library, <a href="https://github.com/ircmaxell/PHP-PasswordLib">PasswordLib</a>. As I've come to expect, <a href="http://www.reddit.com/r/PHP/comments/s9r6f/introducing_passwordlib_a_library_for_hashing/">Reddit</a> was full of interesting commentary on the topic. Some was good, some was bad and some surprised me. What surprised me was the insistence on a global salt (otherwise known as a "<a href="http://barkingiguana.com/2009/08/03/securing-passwords-with-salt-pepper-and-rainbows/">pepper</a>"). So, I started thinking about it some more, and I figured I'd write a post on why I don't use peppers in my hashing algorithms (and why you may want to rethink it too).
</blockquote>
<p>
He starts with an explanation of what a salt is (and isn't) to lead naturally into the idea of a "pepper", a single unique value that's used across an entire site/application for password encryption. He covers four flaws inherent with this method:
</p>
<ul>
<li>There's no proof that using them increases your security.
<li>There are no publicly vetted hashing algorithms that accept a pepper as an argument. 
<li>Using a block cipher instead of a pepper provides a stronger level of encryption and protection.
<li>The entire concept of a pepper is based around a flawed premise. [...] The flaw in that premise is that it's often not just your database that's leaked.
</ul>]]></description>
      <pubDate>Wed, 18 Apr 2012 09:23:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Shay Ben Moshe's Blog: Hashing Passwords Properly]]></title>
      <guid>http://www.phpdeveloper.org/news/16335</guid>
      <link>http://www.phpdeveloper.org/news/16335</link>
      <description><![CDATA[<p>
<i>Shay Ben Moshe</i> has a new post to his blog looking at a method he's come up with for <a href="http://blog.shay.co/hashing-passwords-properly/">hashing passwords the proper way</a> and saving them to a database for future checking. His encryption methods of choice <a href="http://php.net/crypt">crypt</a> and a random salt generator.
</p>
<blockquote>
The easy and common solution for this particular problem is to use an one-way hash function, such as md5 and sha1, which takes the password and encrypts it.
Unfortunately, this method is not as strong as you may think. [...] We can protect our password from rainbow tables and similar attacks by using salts.
</blockquote>
<p>
He talks about storing passwords in a database (never as plain text!) and what rainbow tables are and how they can make it simple for a user to break a poorly hashed value. He shows how to use the <a href="http://php.net/crypt">crypt</a> function together with the sha512 hashing tool to make a salt.
</p>]]></description>
      <pubDate>Fri, 13 May 2011 08:47:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP.net: Security Notice (wiki.php.net)]]></title>
      <guid>http://www.phpdeveloper.org/news/16087</guid>
      <link>http://www.phpdeveloper.org/news/16087</link>
      <description><![CDATA[<p>
On PHP.net there's a <a href="http://www.php.net/index.php#id2011-03-19-2">quick security advisory</a> for those that didn't see the news - the wiki.php.net machine was compromised but has been wiped and all accounts reset and requiring a password reset.
</p>
<blockquote>
The wiki.php.net box was compromised and the attackers were able to collect wiki account credentials. No other machines in the php.net infrastructure appear to have been affected. Our biggest concern is, of course, the integrity of our source code. We did an extensive code audit and looked at every commit since 5.3.5 to make sure that no stolen accounts were used to inject anything malicious. Nothing was found. The compromised machine has been wiped and we are forcing a password change for all svn accounts.
</blockquote>
<p>
The issue was caused by a combination of a problem with the wiki software and a Linux root exploit. <a href="http://www.theregister.co.uk/2011/03/21/php_server_hacked/">The Register</a> has additional comments about the issue and outage.
</p>]]></description>
      <pubDate>Wed, 23 Mar 2011 10:43:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Joshua Thijssen's Blog: Password hashing and salting]]></title>
      <guid>http://www.phpdeveloper.org/news/15853</guid>
      <link>http://www.phpdeveloper.org/news/15853</link>
      <description><![CDATA[<p>
<i>Joshua Thijssen</i> has a new post to his blog looking at <a href="http://www.adayinthelifeof.nl/2011/02/02/password-hashing-and-salting/">password hashing and salting</a> - something that, really, should always be done to help protect your site's user information.
</p>
<blockquote>
Even though it is true in effect that using a salt increases the overall security of your hashes BUT it's not only because your passwords are longer. There is a another (maybe even more important) factor that comes into play, namely the fact they are more secure against rainbow table attacks, but that depends on HOW you season your hashes. Season it incorrectly, and you gain nothing in security even though you think you did...
</blockquote>
<p>
He gets into some of the details about hashing your information, how you can break that hash easily and how salting your information can help reduce that risk. He also points out things like rainbow tables and brute force that could still break these salted passwords.He recommends using a different method than a single salt - a different one for each user with a part stored in plain-text along with the user record.
</p>]]></description>
      <pubDate>Thu, 03 Feb 2011 12:16:31 -0600</pubDate>
    </item>
  </channel>
</rss>
