Imagine situation:
- Application might or might not be run via SSL/TLS
- Application should not know password of the client because client might reuse passwords
Wouldn't then combined client-side and server-side password hashing work the best?
How would creating password work:
- User enters password into a field.
- Local side javascript hashes the password with salt being provided user name
- This hashed data is transmitted over network to the server.
- Server adds randomly generated salt to the hash and rehashes both into a new hash. This new hash and server-side random salt are stored
How would login work:
- User enters password into a field.
- Value of "login" field is taken as salt and local side javascript computes hash.
- This hash is transmitted over the network to the server
- Server takes the salt stored for that user, combines hash with salt and hashes it.
- Server compares new hash with stored hash, if matches, user successfully logged in. If they do not match, user is denied access.
What would be a disadvantage to this approach compared to standard approach with transmitting plaintext password over the internet and then hashing and storing it on the server?
Local side javascript hashes the password with salt being provided user name
? I'm unsure what it means. Also, what is thelogin
field? Do you mean username, password, or other?