nixCraft Poll

Topics

PHP Secure Password Hashing

Posted by Vivek Gite [Last updated: December 5, 2007]

This blog post provides good information about password hashing. The main point of this article is to use strong encryption and make attackers life hard. So if someone gains access to database, attacker could figure out your password using a brute force or rainbow tables.

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. jcinacio Says:

    Yep, recent advances in CPU power allow recovering poorly hashed passwords.

    Besides the (not so obvious to some, but required) salt, there are a couple of rules:

    - password minimum length (unsalted passwords up to 8/9 chars can be easily recovered)
    - variable salt (you can store the salt for each password in the db as well, this increases it’s security exponentially)
    - strong hash function (md5 is considered weak nowadays, sha1 or even better sha256 is the way to go)

    … but most importantly, NEVER store passwords in plaintext, as i still see in many sites that send you your original password on recovery… :/

  2. Lex Says:

    How do you do the variable salt thing in PHP?

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , ,

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.