Don't hash passwords? I say yes. Hash them And correctly
securecoding.ch
securecoding.ch
To store passwords in a database the 'proper hash' to use is openbsd's bcrypt. http://www.openbsd.org/papers/bcrypt-paper.ps
bcrypt(cost, salt, pwd)
state <= EksBlowfishSetup(cost, salt, key)
I guess the symbols "pwd" and "key" are synonyms there, right?http://www.tarsnap.com/scrypt.html
This algorithm is not only provably computationally hard, but provably requires a lot of RAM. Since RAM, and the bandwidth thereof, (unlike password-cracking chips) is as cheap to the consumer as it is to the NSA, you can set your RAM requirements very high to give them a very hard time.
Almost right. There is a lower bound on the time-area product, but not a significant lower bound on the area.
It's not great compared to say Google's viewer for PDFs, but here is a long-standing service that works: http://view.samurajdata.se/
The same goes with hacks. It's easier to get unauthorized read access than unauthorized write access.
That is not the case this protects against
2. Backups have tendency to leak more so than the server security itself.
salt = getLongRandomString(); hash = sha256(salt+password); save_in_db = salt+"$"+hash
Thus, while you don't publish them, salts aren't "secret". That's based on the assumption that a cracker would have to bruteforce each password in turn, and that takes too much time.
But no, you can't re-hash with a new salt without access to the plain-text password. If you could, so could the bad guy :)
Disclaimer: IANAC, and if I were building security for mission critical stuff, I'd ask someone who was.
Yes you can, if you believe this: http://benlog.com/articles/2008/06/19/dont-hash-secrets/ This is exactly why HMAC is more complicated than just:
hash(message+secret)*-Not strictly true. If a user is rotating through a sequence of passwords, changing the salt will obscure that.
$hash = sha1('foo' . $username . $password);
Can someone explain to me why or when this isn't good enough?There was an article linked a while ago that plotted prices to crack common hashes using Amazon's cloud, and even for 8 length alphanumeric + symbol it was over $50,000 of estimated computing, adding a significant unique salt (username in this case) would make it unjustifiable from a monetary point of view.