4 ms·
just a random tidbit.. but the system currently allows you to set your password to what you previously had
by ledude 10y ago
just a random tidbit.. but the system currently allows you to set your password to what you previously had
- emilong 10y agoI actually hope this is true as a consequence of them storing salted hashes for passwords. That is, Github should not ever see my password, only validate that I know what I entered previously.
- e28eta 10y agoIt's pretty easy to keep a list of old salted hashes, and copmare the new password's salted hash against the previous ones. It doesn't require saving the old passwords.
- ikeboy 10y agoIf the salt changes, you'd need to compute the password using multiple salts, which might have crypto guarantee issues when sent to the server.
- niftich 10y agoI don't follow what you're saying. To compare your new password with your old password, you take the old salt, hash your new password together with it, and compare the result to the old hash. If they match, you're trying to reuse the same password. You do this on the server side, naturally.
- ikeboy 10y agoIf everything is done server side, sure.
- niftich 10y agoWhy wouldn't it be? If salted hashing were done on the client side, it means you're actually sending username + saltedhash, instead of username + password to the server to log in. So an attacker could submit a precomputed or stolen salted hash to be compared against the stored one -- completely defeating the point of hashing passwords in the first place.
- ikeboy 10y ago>Why wouldn't it be? So that the server never gets any plaintext. >So an attacker could submit a precomputed or stolen salted hash to be compared against the stored one -- completely defeating the point of hashing passwords in the first place. You could hash once on the client and once on the server to get the best (?) of both worlds. Really only the server one needs to be salted.
- icebraining 10y agoI don't see what hashing on the client gets you.
- ikeboy 10y ago>So that the server never gets any plaintext. Mitigates attacks that exploit the server but not the served js. See also https://security.stackexchange.com/questions/53594/why-is-client-side-hashing-of-a-password-so-uncommon https://security.stackexchange.com/questions/53594/why-is-cl... for some discussion: the first answer has the same thing I proposed, hashing on both the client and server. I guess another benefit might be constant size passwords, which may mitigate side channels or sniffing. How can it hurt? If there's no harm, but some upside, then why not?
- icebraining 10y agoSince the resulting hash must be deterministic, you can't use a salt, and since you may login from crappy smartphones without JIT engines, you can't use many rounds. So the resulting hash will be trivially cracked using rainbow tables. The problem of variable-length passwords is better solved by only allowing the use of block ciphers in your TLS configuration, which you should probably do anyway. As for the disadvantages, it makes logins take longer, forces the use of JavaScript, increases the complexity of code and increases the site size.
- pfg 10y agoI'm not following that logic. Using salted password hashing would not prevent them from checking your new password against the previous hash.