6 ms·
The server knows the plaintext password in order to hash it, salt it, and compare it. How else would it do that
by VWWHFSfQ 5y ago
The server knows the plaintext password in order to hash it, salt it, and compare it. How else would it do that
- p0sixlang 5y agoI thought it could get hashed client side
- VWWHFSfQ 5y agoThen the hashed password is effectively the plaintext password
- sascha_sl 5y agoExcept, if you run rounds on the client and server, you now never handle plain passwords (that users might be reusing) and reversing the thing you store into something you can use against that services' API is still just as hard (if not harder because you need to do either do the total rounds on plain or the server rounds on a very long input)
- lxgr 5y agoNot if it's scoped to the username/domain in some way (e.g. by making the client-sent value H(password, username, domain) rather than just password or H(password)). But that would require a canonical and secure (i.e. not (only) controlled by server-fetched code) way of client-side password preprocessing, and if you have that, you can just as well use a PAKE, modern instances of which have all of these nice properties and more.
- thamer 5y agoIt's not the same. If you the un-hashed password leaks it can often be used to authenticate on other websites since people reuse passwords. You can't do that if all you have is the hashed password.
- sascha_sl 5y agoThe browser can do it too, Keybase handled passwords like that.
- titaniczero 5y agoNo, the server doesn't "know" the plaintext password, the server knows the hashed password and the salt. The plaintext password is in memory during your login request's lifetime, once it is hashed and compared against the stored hashed password, the plaintext version no longer exists on the server. Very different case from storing them in plain text in the database or elsewhere.
- VWWHFSfQ 5y agoIf the plaintext password traverses the server's memory space then yes it "knows" the plaintext password. A nefarious server administrator can do whatever they want with those plaintext passwords.
- lxgr 5y agoThere is a large difference in attack surface there, though: Passwords stored unhashed in a database fail catastrophically and irrevocably against a point-compromise attacker. Hashed passwords, validated using plaintext passwords, only leak all passwords entered since the moment of compromise.
- VWWHFSfQ 5y agoI'm certainly not denying that. But to try to claim that the server doesn't know the real password is completely false. Whether they hash/salt the stored value is completely irrelevant to the point that you have to trust the plaintext password handling end-to-end since the server can do anything it wants with your real password.
- stefs 5y agoit's not about nefarious server administrators, it's about an attacker getting in, dumping the database content, logs and whatever else they can grab. they then search those for valuable information they can sell - like email addresses, username+password combos, payment info, the likes. those are then bundled and sold on the darknet to spammers and phishers. if the credentials are in the logs they'll harvest those to attempt logins on other sites.
- unethical_ban 5y agoNot always. The client could salt and hash the password before sending it to the server for storage and comparison. To be clear: a properly designed system can and should operate without the server ever knowing the plaintext password.