 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Andrew Podner: PHP 5.5 Preview New Password Hashing API
by Chris Cornutt March 25, 2013 @ 12:32:26
Andrew Podner has posted about the password hashing functionality that's coming with PHP 5.5 - how it will work and some of the benefits of its use.
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.
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 this compatibility library to have a similar interface and functionality (for 5.3.7 or greater).
voice your opinion now!
preview password hashing api compatibility library introduction
PHPMaster.com: Password Hashing In PHP
by Chris Cornutt January 14, 2013 @ 11:57:32
On PHPMaster.com there's a new tutorial that wants to help you keep your application and users a bit safer - a guide to password hashing for PHP applications.
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.
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 md5/sha1 (note, these are not recommended) but moves into more effective options like sha256, salted hashing and even bcrypting passwords with crypt.
Be sure to check out the comments for other security concerns and links to suggested tools and resources.
voice your opinion now!
password hash tutorial md5 sha1 sha256 bcrypt
Anthony Ferrara: Designing An API Simplified Password Hashing
by Chris Cornutt November 19, 2012 @ 12:42:22
A while back Anthony Ferrara proposed a standardized password hashing feature to be included into the core of PHP. It was voted on and it was decided it would be introduced in the PHP 5.5 releases. Anthony has written up a new post talking some about his process in making this upcoming feature and answering some of the most common questions he's gotten about it.
The other day, PHP 5.5 Alpha 1 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 Simplified Password Hashing API 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...
He talks about some of his goals with the use of the functionality (simplicity, something "the 99%" can use) ans answers questions about:
- Why the functions aren't namespaced
- Why it's not just a class that can be included when needed
- The choice of not going with an OOP interface
- Why PBKDF2 and Crypt-SHA-512 aren't supported
...and several other questions, but you'll have to read the full post for the rest of those. You can find out a lot about the API for this functionality from its wiki page and, if you'd like to try it out (in an alpha state), you can download this version of PHP and compile it yourself.
voice your opinion now!
api design questions password hashing simple alpha
Reddit.com: Login Security (Best Practices Recommendations)
by Chris Cornutt August 14, 2012 @ 12:20:08
On Reddit.com there's a good conversation going on in the PHP category about login security and best practices surrounding it.
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)?
There's lots of comments so far and a lot of them are following along the same lines - use a better method of encryption, something like crypt with Blowfish or something similar as well as some hashing (like HMAC).
voice your opinion now!
security password hash encrypt bestpractice discussion
Oscar Merida's Blog: Using bcrypt to store passwords
by Chris Cornutt June 15, 2012 @ 10:52:41
Oscar Merida has a recent post to his blog about using the bcrypt functionality to more securely store the password information for your application's users.
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 Bcrypt encryption.
[...] 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.
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 crypt 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.
voice your opinion now!
bcrypt password store user tutorial blowfish
Anthony Ferrara's Blog: Properly Salting Passwords, The Case Against Pepper
by Chris Cornutt April 18, 2012 @ 09:23:31
In this new post to his blog Anthony Ferrara looks at a common idea that comes up when the discussion of encryption of passwords in PHP - the global salt (or "pepper").
The other day I announced the release of my new password hashing library, PasswordLib. As I've come to expect, Reddit 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 "pepper"). 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).
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:
- There's no proof that using them increases your security.
- There are no publicly vetted hashing algorithms that accept a pepper as an argument.
- Using a block cipher instead of a pepper provides a stronger level of encryption and protection.
- 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.
voice your opinion now!
password encryption salt pepper cipher
Shay Ben Moshe's Blog: Hashing Passwords Properly
by Chris Cornutt May 13, 2011 @ 08:47:42
Shay Ben Moshe has a new post to his blog looking at a method he's come up with for hashing passwords the proper way and saving them to a database for future checking. His encryption methods of choice crypt and a random salt generator.
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.
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 crypt function together with the sha512 hashing tool to make a salt.
voice your opinion now!
password hashing crypt sha512 tutorial
PHP.net: Security Notice (wiki.php.net)
by Chris Cornutt March 23, 2011 @ 10:43:05
On PHP.net there's a quick security advisory 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.
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.
The issue was caused by a combination of a problem with the wiki software and a Linux root exploit. The Register has additional comments about the issue and outage.
voice your opinion now!
security wiki compromised linux root exploit bug svn password
Joshua Thijssen's Blog: Password hashing and salting
by Chris Cornutt February 03, 2011 @ 12:16:31
Joshua Thijssen has a new post to his blog looking at password hashing and salting - something that, really, should always be done to help protect your site's user information.
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...
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.
voice your opinion now!
hashing salting password tutorial rainbowtable bruteforce
|
Community Events
Don't see your event here? Let us know!
|