3 ms·
One important reason we hash passwords is protect what is essentially a user secret (one which the user may use across many different services) from prying DBAs
by nly 7y ago
One important reason we hash passwords is protect what is essentially a user secret (one which the user may use across many different services) from prying DBAs. In that respect client-side hashing (with salting) makes perfect sense.
The other major benefit of server-side hashing, to what you're correctly surmising, is that it prevents certain privilege escalations. A read-only database dump (from e.g. SQL injection in to a SELECT query) can otherwise be used to gain read-write access by simply copying dumped passwords from the database back in to the login form. The thing is, server-side hashing doesn't actually prevent this attack, it merely slows it down. It also doesn't help at all with weak passwords.
In any case, to address your concern you can also simply run the client-side hashed value (which could and should be produced by something like Argon2) through a single round of SHA2.