4 ms·
This should just be how websites work. I see no reason that a site should ever transmit the user's password over the wire. When you create a password send the
by Spivak 7y ago
This should just be how websites work. I see no reason that a site should ever transmit the user's password over the wire.
When you create a password send the client a salt, hash their real password client side, and send the hash over the wire. Treat it as you would their actual password and salt/hash it again.
Then when the user wants to auth send the client the salt you have on file for them^ and repeat. Bam. A domain specific password for every site even for someone who who reuses passwords.
^ inb4 "this creates another 'step' when logging in." Users will type their username and pw before they get the salt and the client will handle the rest.
- jedberg 7y agoWhat 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.
- 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.
- vbezhenar 7y agoWhat if I don't want to force users to use JavaScript? Also I agree that it's not clear how is it useful, if your server password database is already hashed.
- anamexis 7y agoYou could use HTTP digest authentication, with the salt as the realm. https://en.wikipedia.org/wiki/Digest_access_authentication https://en.wikipedia.org/wiki/Digest_access_authentication
- vbezhenar 7y agoOriginal implementation uses MD5. While I think that it's not broken, many people don't like those 3 letters and will avoid just for that. There are modern RFCs, but browsers are not adopting it. For example this Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=472823 https://bugzilla.mozilla.org/show_bug.cgi?id=472823
- barbegal 7y agoI agree MD5 is not broken for digest authentication. MD5 is only weak for chosen-plaintext or brute force attacks. With a correctly generated nonce, it is more than secure enough.
- jacekm 7y agoAlternatively we could use public key cryptography and challenge-response protocol. Browser could generate a pair of keys during registration and send public key to a server. While logging in server would send a token that would have to be signed with private key. Server would grant access upon verifying signature. Private keys should be password-protected and could be synced across devices via Chrome/FF account. Or we could use WebAuthn. I am very curious whether it will get any recognition and support. I am definitely rooting for it.
- iancarroll 7y agoThere is already a standard for this, called SRP: https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol https://en.wikipedia.org/wiki/Secure_Remote_Password_protoco...
- rladd 7y agoThis is claimed in the linked Wikipedia article to prevent phishing but how could it? If the phishing site presents a ui that looks like the real site, the user could be tricked into entering his real username/password which the attacker could then use to log into the real site. Or am I missing something?