<?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>Mon, 20 May 2013 08:28:06 -0500</pubDate>
    <ttl>30</ttl>
    <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: Seven Ways To Screw Up BCrypt]]></title>
      <guid>http://www.phpdeveloper.org/news/18934</guid>
      <link>http://www.phpdeveloper.org/news/18934</link>
      <description><![CDATA[<p>
If you're going to be rolling your own user handling in your application, no doubt you've heard that something like bcrypt-ing your passwords is a good idea. Well, <i>Anthony Ferrara</i> <a href="http://blog.ircmaxell.com/2012/12/seven-ways-to-screw-up-bcrypt.html">has some suggestions</a> for you and shows you seven ways you can "screw up" when trying ti implement it.
</p>
<blockquote>
There are numerous articles on the web about how to properly use bcrypt in PHP. So this time, rather than write yet-another-how-to-use-bcrypt article, I'm going to focus on the mistakes that are commonly made when implementing bcrypt. 
</blockquote>
<p>Here's the list of seven ways (each has its own description in the post):</p>
<ul>
<li>Using A Non-Random Salt
<li>Using An Incorrect Random Source for Salt Generation
<li>Using Too Weak Of A Cost Parameter
<li>Using The Wrong PHP Version
<li>Using The Wrong Prefix
<li>Not Checking For Errors
<li>Not Using A Library
</ul>
<p>
He also includes two "bonus" things to consider: "Not Using A Timing Safe Comparison" and "Not Encoding The Salt Correctly".
</p>]]></description>
      <pubDate>Fri, 21 Dec 2012 12:20:04 -0600</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>
  </channel>
</rss>
