3 ms·
Normally, if I understand right, the point of hashed passwords, is what is sent from client to server to auth is the ACTUAL password. Then the actual password
by jrochkind1 13y ago
Normally, if I understand right, the point of hashed passwords, is what is sent from client to server to auth is the ACTUAL password.
Then the actual password is hashed, and the hash of the input password is compared to the previously stored hash, to see if it matches.
This way, you need the actual password to auth, but the actual password is stored nowhere by the app, only the hash is -- so the actual password can't be stolen by getting access to the db or the file system or anything else, because it's simply not there. But it's what you need to auth.
This is really the whole point of storing hashes rather than original passwords. Right?
Now, I guess that would mean you'd store the _actual_ password in the cookie. But that does sound risky, even if the cookies are https only. Which is why usually you store a _session id_ in the cookie, and auth the session with a single auth action, not store the password in a cookie.
- mnw21cam 13y agoIf I could upvote you multiple times I would. I see a lot of confusion on this matter, even on HN. When authenticating, the server needs to do a hashing step to compare against the password database. Otherwise, it isn't a hashed password database - it's a plaintext password database.