Live data from Hacker News

How To Safely Store A Password (2010)

codahale.com

51–60 of 65 posts

Re: How To Safely Store A Password (2010)

#52

Cryptographic hashing decreases entropy because it is based on a compression function. Most password stretching algorithms are not optimal in that respect, especially if they repeatedly lengthen the plaintext before hashing it again. There are constructions to avoid this problem but they are not commonly used.

Please elaborate. Your complain comes about passive-aggressive if you do not explain why the problem is a problem or how to solve it.

Re: How To Safely Store A Password (2010)

#53
post #2

Bcrypt doesn't have memory-hardness, so has high susceptibility to ASIC attacks. In particular, it incurs the same or lower cost factor on the attacker than the user. More recent designs such as scrypt and Argon2 force high memory usage as well as computation time, incurring little cost on the users but making ASIC and GPU attacks significantly less cost-effective. Of course, any of these will still give better prote…

Is scrypt actually recommended? When I think of scrypt, I think of the Litecoin and the numerous "altcoins" that use scrypt that were forked from Litecoin in late 2013/early 2014.

I know that Litecoin used scrypt to harden it against GPU/ASIC mining, but GPU/ASIC miners ended up coming out anyways. With this in mind, is scrypt actually a better option than bcrypt?

Re: How To Safely Store A Password (2010)

#54
post #30

I have started to look at a model where the device itself is the password. How often do we realistically need to concern ourselves with the scenario where multiple users are utilizing the same physical device in 2020? Imagine every device has a cookie/token with 256-512 CSPRNG bytes which uniquely identify it. The server uses this as the exclusive means of authentication. For sensitive application scenarios, an in-ap…

> They just need to make sure they have a backup device and/or offline recovery options available.

There's the hard part.

Go to the World of Warcraft forums and ask how many people have had trouble dealing with identity verification with Blizzard because they lost or destroyed their phone and no longer have access to the Blizzard Authenticator app and are therefore locked out of their account. Sure, the app will give you backup codes you can use to restore the Authenticator on a new device, but clearly very few people are actually recording those somewhere.

> Developers screw up password hashing constantly.

Developers should know better. There's no excuse for continuing to use poor/no hashing for password storage.

> Malicious actors should grow to strongly dislike this approach.

Not as much as you think. Considering how many people still think that fingerprints are secure, if stealing someone's device means having access to everything they have, then "your device is your password" is flawed. PINs and swipe patterns are trivial to shoulder surf.

Re: How To Safely Store A Password (2010)

#55

Cryptographic hashing decreases entropy because it is based on a compression function. Most password stretching algorithms are not optimal in that respect, especially if they repeatedly lengthen the plaintext before hashing it again. There are constructions to avoid this problem but they are not commonly used.

[deleted]

Re: How To Safely Store A Password (2010)

#56

I always say the best piece of advice on this is, "Don't store passwords." Like shown in other comments, the landscape of what should be used changes frequently. Truthfully, I haven't had to write anything that stores passwords for several years, and until now I hadn't heard of Argon2. That's frightening to me and shows how far out of the game I am now. Finding a trusted 3rd party who's responsibility is to stay on t…

What's the backup plan when 3rd party will ban your website because of any reasons?

Send people emails to reset their password with your new auth solution.

Re: How To Safely Store A Password (2010)

#57

Cryptographic hashing decreases entropy because it is based on a compression function. Most password stretching algorithms are not optimal in that respect, especially if they repeatedly lengthen the plaintext before hashing it again. There are constructions to avoid this problem but they are not commonly used.

This is definitely true as far as the math goes, applying a prf does reduce entropy. But does it decrease it in a way that an attacker can take advantage of?

Re: How To Safely Store A Password (2010)

#58
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

>recommended against by NIST

As a layman who has too many passwords that rotate too often to keep in memory effectively, I'd like to pass this along to our IT department. Can someone post a link to the NIST best password practices?

Re: How To Safely Store A Password (2010)

#59
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

It's also important to note that password rotations are not recommended by NIST as long as the other guidance is also being followed, i.e. password length requirements. I've seen people quote small sections of NIST recommendations while missing out on the context.

Re: How To Safely Store A Password (2010)

#60
post #31

> Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use argon2. Use argon2. Use argon2. Use argon2. Use argon2. Use argon2. Use argon2. Use argon2. Use argon2. https://github.com/P-H-C/phc-winner-argon2

Is Argon2 as tried and tested as bcrypt?

It doesn't matter. For password hashing, Argon2 is fine. bcrypt is fine. scrypt is fine. You should distrust people who make a big deal out of which one you use.
Post reply on HN