4 ms·
Assume that all clients for a site use password managers with good random password generators, which they use to generate their site password. They are all, say
by tzs 9y ago
Assume that all clients for a site use password managers with good random password generators, which they use to generate their site password. They are all, say, 40 characters chosen from [a-z][A-Z][0-9], so about 238 bits.
Would it be terrible in that case to just say "screw it", and just go with the old classic salt + single hash (SHA256, probably) instead of scrypt or bcrypt or PBKDF2 or similar?
- cperciva 9y agoNo, that would be just fine. The sole purpose of password based key derivation functions is to maintain robustness in the presence of weak(er) passwords. For that matter, if your passwords really have 238 bits of entropy, you don't even need a salt.
- sbierwagen 9y agoWell, sure, if all users were guaranteed to use a strong password that wasn't reused for any other site, we wouldn't need a lot of password safety rules. Heck, you could just store them in plaintext. In practice though, users don't.
- joveian 9y agoA single hash is still a good idea since otherwise anyone who steals the password database can log in as any user. Sure if someone can steal the password database they may be able to steal passwords as users log in, but that is at least harder. To make sure users have secure passwords, the server can just generate them and tell the client what their password is. It is, as far as I can tell, entirely a historical accident that this is not how it is generally done. For web sites, I'm fairly sure this could be done via browser password storage without the user needing to ever see the password if they only use one system to log in (or browser sync between all systems they use). IMO, 21 character random base-64 passwords are good, enough security and still possible to memorize (three groups of seven) over a couple of weeks if necessary.