3 ms·
What do you gain with the extra hashing on the client side? The attack you're protecting against is a compromise of the server's password database. If the att
by jedberg 7y ago
What do you gain with the extra hashing on the client side?
The attack you're protecting against is a compromise of the server's password database. If the attacker has that, then they have the client side salt too.
- toast0 7y agoHashing on the client side prevents the server side from logging the plaintext password anywhere, and from intermediaries from seeing the plaintext password. Replay of the hashed value is still possible, without other measures. Hashing a second time on the server protects from a database leak being used to access the site.
- jedberg 7y ago> Hashing on the client side prevents the server side from logging the plaintext password anywhere, and from intermediaries from seeing the plaintext password. No it doesn't, because all of those attackers have access to the client side salt which is sent to the client in the clear.
- toast0 7y agoThey would have the client side salt and the hashed password. Now, depending on the hashing algorithm, maybe it's easy to turn that back into the plaintext, but with a competent hash, it's not expected to be easy. Edit to add, if the site does it in javascript, of course they (or intermediaries) could decide not to do it, or to also pass the plaintext with the hashed version. That's a separate issue.
- jedberg 7y agoIf you have the salt and the hashing algo, it's trivial to build a dictionary. If the password is good enough to not be broken by a dictionary attack, it was good enough without all the extra hashing.
- Cicero22 7y agoHaving to mount a dictionary attack which may fail/ take an indeterminate period time seems like a win. Albeit only for users who reuse the same, strong password.
- jedberg 7y agoExactly. And if they’re using a strong password already than you haven’t gained anything. The dictionary attack on the client created hash and the attack on the server hash of the plaintext take the same effort.
- Spivak 7y agoRight, but if you steal the client-hash you have the user's password for this service. If you steal their plaintext password you have their password for every service. This measure is to limit the blast radius of a compromised password given that people reuse passwords.
- jedberg 7y agoNo, if you have the salt and the client side hash then you do a dictionary attack and you have their plaintext password, the one they presumably use on multiple sites. All you've done is move your attack from the server to the client. It's the same attack on both ends.
- Spivak 7y agoThis doesn't do anything to make a weak password stronger, it makes a strong password resilient to being compromised over the wire or by an errant console.log(http_request) on the server. If the password is so weak that you can just invert the hash then there's not much that can help you.
- jedberg 7y agoIf they're on the server seeing your console.log, then they can just change the javascript to stop hashing the passwords on the client side.
- ebg13 7y ago> No it doesn't, because all of those attackers have access to the client side salt which is sent to the client in the clear. Why would you send it in the clear?
- jedberg 7y agoIn the same "clear" that the unhashed password would be sent. ie. I'm assuming they've already compromised your https connection, otherwise it's a moot point.