Live data from Hacker News

How To Safely Store A Password (2010)

codahale.com

41–50 of 65 posts

Re: How To Safely Store A Password (2010)

#41

This blog post was instrumental in convincing large swaths of programmers 10 years ago why normal hashing doesn't cut it. This was in a time that PHP code snippets doing md5($password) were widespread. If people were even hashing passwords at all. It was a time when lots of crypto was hard to use for programmers, and the jargon gap between cryptographers and programmers was even bigger than it was now. A blog post th…

Strong agree, noting also that bcrypt still holds up well.

Articles like these set off a bit of a research fad in designing password hashes, which is great, but also created the impression that using the wrong password hash is like using SHA1 or 1024 bit RSA, which is not the case. By all means, use Argon2 if you like; it is "better", but not decisively so. Or just put PBKDF2, scrypt, bcrypt, and Argon2 on a wall and throw a dart.

The danger is in not using a password hash at all, but rather using a "salted hash".

Re: How To Safely Store A Password (2010)

#43
post #29
post #22

With password storing, you want to cover your ass. One way to do it is follow guidelines of known authority, e.g. NIST or OWASP. OWASP has nice document: https://cheatsheetseries.owasp.org/cheatsheets/Password_Stor... It boils down to this: > Bcrypt is the most widely supported of the algorithms and should be the default choice unless there are specific requirements for PBKDF2, or appropriate knowledge to tune Argon2…

Interesting how many corporate security policies act like they don't even know NIST exists. Password rotations for users are audit crown jewels but recommended against by NIST

NIST used to recommend password rotations not that long ago, pretty recent change.

I work in a compliance heavy environment and have tried getting the rotation policy changed, but it's baked into so many contracts at this point it will take another 5+ years before we to the ~2018 era guidelines.

Re: How To Safely Store A Password (2010)

#44
Just me quibbling about language, but this article should really be titled "How To Safely Store A Hash That Lets You Verify A Password". Nobody who knows what they're doing (including the author) advocates storing passwords, even encrypted.

But an article with that title would probably be less visible to the audience that really needs to read it.

Re: How To Safely Store A Password (2010)

#46

So there's a bunch of people here saying Argon2, whereas I thought one of the current best recommendations was scrypt. Can someone explain the trade-off between them? Why would you pick one over the other? Or are both "pretty much fine" for most workloads and a casual user shouldn't worry too much?

Going off of memory, happy to be corrected.

So something like pbkdf2 is intended to be "CPU hard" ie: it bottlenecks you on CPU. Then people started using GPUs for pbkdf2.

So we got bcrypt, which is CPU hard and uses enough memory that a GPU stops being particularly practical.

And then people build ASICs to bruteforce bcrypt faster. So we got scrypt and argon2, which are memory hard.

But the thing is that even PBKDF2 is pretty good. You can always just bump up the iteration count for PBKDF2 to increase security. I use a combination of PBKDF2 and bcrypt myself (pbkdf2 on the frontend, bcrypt on the backend).

Re: How To Safely Store A Password (2010)

#47
post #37

I cracked a lot of sha512crypt and PBKDF2-HMAC-SHA256 hashes with a cheap GPU at Defcon this year. Here's the write-up. (Cracking Passwords with Cheap Hardware at Defcon): https://github.com/62726164/cmiyc2020

Do I understand correctly that you cracked about half of the 12,000-iteration PBKDF2 hashes using a first-gen ThreadRipper and a GTX 1060, and would have cracked more except for a formatting problem in the hashes? That's eye opening.

Is Word Machine publicly available, or is it the sort of thing that has an audience of one?

Re: How To Safely Store A Password (2010)

#48
> So I’m not saying salts are without purpose, I’m saying that they don’t prevent dictionary or brute force attacks (which they don’t)

Only true if you don't know the salt. Of course, most folks store the hash and salt in the same table or column (Django).

Re: How To Safely Store A Password (2010)

#49
How To Safely Store a Password (2020): Don't

Feeling glib, but passwords are hot potatoes best to avoid if you can. There are plenty of OpenID Connect providers to pass off the buck to, or an increasing number of "passwordless" options including the simple scheme of one-time codes delivered to user email addresses.

Re: How To Safely Store A Password (2010)

#50
post #37

I cracked a lot of sha512crypt and PBKDF2-HMAC-SHA256 hashes with a cheap GPU at Defcon this year. Here's the write-up. (Cracking Passwords with Cheap Hardware at Defcon): https://github.com/62726164/cmiyc2020

Do I understand correctly that you cracked about half of the 12,000-iteration PBKDF2 hashes using a first-gen ThreadRipper and a GTX 1060, and would have cracked more except for a formatting problem in the hashes? That's eye opening. Is Word Machine publicly available, or is it the sort of thing that has an audience of one?

Yes, that's right. I may have not cracked them during the contest (but just after). I don't recall. Once I figured out the pattern, I could attack it much more efficiently. So, it's not as impressive as it seems.

And, unfortunately, wm has an audience of one. Mostly because I'm ashamed to share it.

Post reply on HN