Earlier quoted context omitted.
It's pretty easy to migrate users from one hashing algorithm to another when they next log in: if( user has an old style hash ){ if( password verifies against old style hash ){ add a new style hash delete the old style hash log them in } } else { if( password verifies against new style hash ){ log them in } }
Eh, why not just bcrypt the SHA1/MD5 hashes? Your auth check will just become bcrypt(SHA1(pass)) rather than bcrypt(pass). You can convert all passwords right away and I don't see any significant downside to it.
Md5crypt is no longer strong enough
91–100 of 144 posts
Re: Md5crypt is no longer strong enough
#92>All major internet sites, anybody with more than 50.000 passwords, should design or configure a unique algorithm for their site He probably means to use some combination of well known/tested algorithms rather than inventing your own crypto, but I think his wording is ambiguous enough to be dangerous. While there is some benefit to using a unique algorithm for your site, it's almost certainly more risky than using a…
Isn't salting a canonical way to vary the output for the same input, thus reducing feasibility of precomputed attacks like rainbow tables? What are the benefits of some extra mangling, besides security through obscurity?
Re: Md5crypt is no longer strong enough
#93Earlier quoted context omitted.
The problem is that you may have to keep this code for a VERY long time (people don't log into sites for 3+ years and expect their old passwords to still work). Lugging around legacy code is never a good idea.
I agree that lugging around legacy code but whats the alternative? (Note I'm not a security expert) AFAIK its this 1. Continue using legacy, less secure hashing algorithm 2. Upgrade your password storage scheme and carry around some extra code and/or fields in your db. 3. Crack you own users passwords and convert them Its all kind of smelly but 2 seems like the only option (unless I'm missing an option?)
Regular users should have no problems if there's an accompanying blog post Non-regular users might just remember about your site/service and come back :)
5. Use bcrypt/password stretching. Store the work value alongside the password and upgrade it as people log in. To me that's not really keeping legacy code around; just an extra variable...
Re: Md5crypt is no longer strong enough
#94Please notice that there is _no_ advantage in everybody in the world using the exact same algorithm, quite the contrary in fact. If your password database is leaked, there are 2 categories of attacks that you need to be concerned with: 1. Brute force 2. A weakness in your implementation He's right that brute force attacks will require potentially more work if you have a custom scheme as the attacker will have to work…
Re: Md5crypt is no longer strong enough
#95Earlier quoted context omitted.
You mean you're sending unhashed passwords from the client?
Yes. That is the standard behaviour that nearly all sites use, and is perfectly fine.
Re: Md5crypt is no longer strong enough
#96Earlier quoted context omitted.
Eh, why not just bcrypt the SHA1/MD5 hashes? Your auth check will just become bcrypt(SHA1(pass)) rather than bcrypt(pass). You can convert all passwords right away and I don't see any significant downside to it.
That would be fine if you wanted to retain the legacy hashing function. I was describing a migration from one hashing algorithm to another. You're describing modifying the existing hashing algorithm, which is something different.
Re: Md5crypt is no longer strong enough
#97Re: Md5crypt is no longer strong enough
#98Please notice that there is _no_ advantage in everybody in the world using the exact same algorithm, quite the contrary in fact. If your password database is leaked, there are 2 categories of attacks that you need to be concerned with: 1. Brute force 2. A weakness in your implementation He's right that brute force attacks will require potentially more work if you have a custom scheme as the attacker will have to work…
I think what he's suggesting is composing secure hash functions with some simple customisable steps, like xor, negation, so that the final result is as secure as scrypt, bcrypt, what have you, but also customized, so that standard tools won't work, and the attacker would have to do some custom legwork to attack your application. This, done correctly, would increase the cost of attacking to the point of making drive-b…
Incidentally, what kind of drive-by attack are you thinking? Like, you have your password database sitting out in the open and there are bots crawling the web trying mechanically to crack it? Because that doesn't sound like a common case, but I'm not sure what else you could mean.
Re: Md5crypt is no longer strong enough
#99Earlier quoted context omitted.
Graceful degradation is pretty easy. Override the form submit handler to hash the password, set a flag that the password is hashed, empty the original password, and submit the form. Users with JS blocked will just submit the unhashed password as usual. Of course, if you're salting the hash uniquely for each user, then this approach isn't very helpful. Finally, if your server will accept hashed passwords, then getting…
> Of course, if you're salting the hash uniquely for each user, then this approach isn't very helpful. I've seen this advised a lot. However, where are you going to put the per-user salt? I presume in your users table, or somewhere in your db. Does this not mean that the salts are just as likely to be hacked as the encrypted passwords? Are you not better off with either a single salt that's stored somewhere outside y…
If you store straight unsalted hashes, you can precompute the hash for every likely password, store the precomputed hash -> password mappings in a nice efficient data structure (http://en.wikipedia.org/wiki/Rainbow_table) and use the same precomputed tables to reverse every hash in the system with a very fast lookup. And every other system using the same unsalted hash scheme.
If you have a salt, this doesn't work -- you'd need a set of precomputed tables for each salt value, which rather defeats the object of precomputation.
If you take it a step further, and use a storage scheme like bcrypt or PBKDF2, not only are you protected from the precomputation attacks, but testing each password candidate takes much longer than a straight cryptographic hash -- so brute force attacks becomes much slower, too.
Re: Md5crypt is no longer strong enough
#100Earlier quoted context omitted.
Graceful degradation is pretty easy. Override the form submit handler to hash the password, set a flag that the password is hashed, empty the original password, and submit the form. Users with JS blocked will just submit the unhashed password as usual. Of course, if you're salting the hash uniquely for each user, then this approach isn't very helpful. Finally, if your server will accept hashed passwords, then getting…
> Of course, if you're salting the hash uniquely for each user, then this approach isn't very helpful. I've seen this advised a lot. However, where are you going to put the per-user salt? I presume in your users table, or somewhere in your db. Does this not mean that the salts are just as likely to be hacked as the encrypted passwords? Are you not better off with either a single salt that's stored somewhere outside y…