Contents
- 1 When to hash password server side or client side?
- 2 Is it bad to send hashed password to server?
- 3 Which is a good case for client side hashing?
- 4 What’s the point of hashing passwords for authentication?
- 5 Which is more secure client side or server side?
- 6 Why are passwords weak on server side and client side?
- 7 Is it safe to hash password on ride over?
When to hash password server side or client side?
Indeed, the point of hashing the password client side is that the server is potentially hostile (e.g. subverted by an attacker), and thus Javascript code sent by that server is, at the very least, suspect. You do not want to enter your precious password in some hostile Javascript… Another case for client-side hashing is about slow hashing.
What happens if everybody hashes the same password?
Which is evidenced by the fact that if everybody did the same client side hash thing, then the attacker would be able to reuse those hashes. Thus, if the user has different passwords for different services, you approach earns nothing. Addendum: What if you wanted to defend the user from the administrators?
Is it bad to send hashed password to server?
As any good site should be using TLS, the fact that the hash is being sent to the server is irrelevant (Note that even if this was a concern sending the plain text password would be just as bad).
How can I check the hash of my Password?
REHASH the hash on your server with a salt and compare that to what is stored in your database (store the password like this: (save the salt as plaintext in the database as well)). And send your password like this:
Which is a good case for client side hashing?
A good case for client-side hashing is the way some “password safes” work: they compute a site-specific password by hashing the user’s “master password” together with the site name. This gives most of the usability of always using the same password everywhere, while not actually giving your master password to dozens of distinct site.
Where are hashed passwords stored on a server?
Since the (hashed) passwords sent by the clients are stored as-is in the database, such an attacker can impersonate all users by sending the server the hashed passwords from the database as-is.
What’s the point of hashing passwords for authentication?
The idea being that the hash is reproducible for authentication, yet hopefully not vulnerable to reverse-engineering attacks (to discover the literal password) other than brute force if the server data is compromised.
How does an attacker use a hash on a password?
From an attacker point of view, the hash is all it’s needed to gain access to the login (i.e. the attacker spoofs the hash in transit and uses it to gain access to the server). That’s exactly the same scenario as if the client was sending the plain text password. The attacker would spoof the clear text password and use it to login.
Which is more secure client side or server side?
We are debating which is more secure: hashing a password on the client side (via a javascript SHA-256 function) or hashing it on the server side. My point of view is that by hashing on the client side, the unencrypted password is never passed across the network.
How to Salt a password on the client side?
On the client side generate the salt using the username (or whatever user data is available) assuming it is unique. Then you generate the hash on the concatenated password and salt and send it on the server. On the server side, you calculate the salt using the same salting function in the client with the username as the input.
Why are passwords weak on server side and client side?
Since passwords are, by definition, weak, you want to thwart dictionary attacks. You assume that the bad guy got a copy of the server database, and will “try passwords” on his own machines (see this blog post for some discussion on this).
What’s the best way to hash a password?
Use HTTPS. Securely hash passwords, irreversibly, with a unique salt per password. Do this on the client – do not transmit their actual password. Transmitting the users original password to your servers is never “OK” or “Fine”.
Is it safe to hash password on ride over?
Hashing on the ride over helps cover vulnerabilities of transport, if SSL connection is compromised, they still can’t see the raw password. It won’t matter in terms of being able to impersonate authorized users, but it will protect your users from having their passwords read in association w/ their email.