For instance, lets look at a common login system for a website
- HTTPS connection is made
- User submits credentials via POST
- Server-side code hashes the password and looks if it matches the user name
- Session is initialized, and a key may be issued to log in again without passwords ("remember me")
This is generally the status quo right now, where passwords are all computed on the server. But, if we do the following client-side it's considered a bad practice:
- HTTPS connection is made
- JavaScript calculates the hash (may request specific user salt)
- Script sends AJAX with the user/hash values
- Server-side code looks if the password's hash and user name match.
- Session is initialized, and a key may be issued to log in again without passwords ("remember me")
Can someone explain why this other method is considered bad practice to do it CS instead of SS? Both transmit over SSL, both create the secure hash, and both authenticate should be be considered reliable with well-written code. Both are susceptible to XSS and other bad design.