<?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>Fri, 24 May 2013 02:16:05 -0500</pubDate>
    <ttl>30</ttl>
    <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[Joseph Scott's Blog: Slow Hashing]]></title>
      <guid>http://www.phpdeveloper.org/news/17797</guid>
      <link>http://www.phpdeveloper.org/news/17797</link>
      <description><![CDATA[<p>
In <a href="http://josephscott.org/archives/2012/04/slow-hashing/">this new post</a> <i>Joseph Scott</i> takes a look at hashing in PHP, specifically around <a href="http://php.net/md5">md5</a> hashes, and a better alternative (that's also more secure.
</p>
<blockquote>
The majority of the <a href="http://www.codinghorror.com/blog/2012/04/speed-hashing.html">Coding Horror: Speed Hashing</a> post talks about speed based on MD5.  [...] If you are still using MD5 to hash passwords (or worse, aren't hashing passwords at all) then please stop and go use <a href="http://bcrypt.sourceforge.net/">bcrypt</a>. For those using PHP <a href="http://www.openwall.com/phpass/">phpass</a> is a great option.
</blockquote>
<p>
He talks about the <a href="http://php.net/crypt">crypt</a> method, how its encryption method and "cost" value effects the speed and how difficult it would be to generate all possible hashes for a password (hint: crypt with a cost of 13 is worlds better than md5).
</p>]]></description>
      <pubDate>Tue, 10 Apr 2012 11:55:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: The Blowfish Debacle]]></title>
      <guid>http://www.phpdeveloper.org/news/17532</guid>
      <link>http://www.phpdeveloper.org/news/17532</link>
      <description><![CDATA[<p>
<i>Davey Shafik</i> has a recent post to his blog about what he calls "<a href="http://daveyshafik.com/archives/35354-the-blowfish-debacle.html">The Blowfish Debacle</a>" - the issues that came up with the PHP 5.3.7 release to upgrade the crypt_blowfish version that resulted in a larger error being introduced.
</p>
<blockquote>
This was a great security fix, solving an issue with insecure passwords due to incorrect behavior. HOWEVER, what wasn't made clear, is that this change was actually a backwards compatibility break. If you upgraded to 5.3.7+ data hashed pre-5.3.7 would no longer match data hashed post-5.3.7; this means if you use it for passwords, it will no longer match. So what's the deal here?
</blockquote>
<p>
He talks about the differences in the two methods of encryption, the newer being the "more correct" way of doing things. If you need the backwards compatibility because of previously hashed values, you can use the "$2x$" prefix instead of the usual "$2a$". He includes a snippet of code that can be used to upgrade all of your previously hashed blowfish passwords up to the new format.
</p>]]></description>
      <pubDate>Mon, 13 Feb 2012 10:02:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevX.com: A Guide to Cryptography in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10123</guid>
      <link>http://www.phpdeveloper.org/news/10123</link>
      <description><![CDATA[<p>
The DevX.com site has posted an <a href="http://www.devx.com/webdev/Article/37821">introductory guide</a> to using cryptography in PHP, showing how to use the various packages the language has to offer.
</p>
<blockquote>
Cryptography is just one piece of the security puzzle, along with SSL/TLS, certificates, digital signatures, and so on. This article explains how to use PHP to implement the most common cryptographic algorithms. In addition to describing PHP's default encryption functions, you'll see how to use a wide variety of cryptographic libraries and packages.
</blockquote>
<p>
They start with a look at some of the built-in functions like md5, sh1 and crypt as well as a table detailing the different encryption methods (like mcrypt, mhash or crypt_blowfish). They follow this up with examples of some of them including a method for making secret keys with the <a href="http://pear.php.net/package/Crypt_DiffieHellman">Crypt_DiffieHellman PEAR Package</a>.
</p>]]></description>
      <pubDate>Tue, 06 May 2008 13:47:22 -0500</pubDate>
    </item>
  </channel>
</rss>
