views:

50

answers:

3

I have found a lot of posts on hashing at the client but none that quite answer my question.

I would like to hash user passwords at the client so that I don't have to send a plain text password across the web but I have a question as to how i might do so successfully when using a salt.

The normal procedure of validating a password is.. 1) user enters username and password 2) recover salt based on username 3) hash password and salt 4) check hash against db

If this all takes place on the server, this is no big deal but it becomes complicated if you are on the client. 2) would have to be a call back to the server while maintaining the password somewhere (without posting it) so.. ajax? Is that the best way or am i missing something?

Thanks in advance!

+4  A: 

Sending a hashed password over an unencrypted connection is no better than sending the unhashed plain text password. A bad guy can intercept the hashed password and replay that as the credential later.

What you want is to send the real password over SSL.

Jonathan Feinberg
Regarding hashed password, that's not exactly true. The usual way to work it around it using a 'nonce', like HTTP Digest Auth does for example. http://en.wikipedia.org/wiki/Cryptographic_nonce
Lukáš Lalinský
+1  A: 

As a more secure alternative to sending unencrypted hashes or passwords across an unsecured channel (but still less secure than SSL), you might look at Digest Authentification.

As was stated above, sending the hash across an insecure channel would still allow someone else to log on as the user.

Jason
A: 

Thanks guys, I don't know what I was thinking. Ill check out the Digest.

Nate
@Nate: welcome to SO! You should do three things: 1. delete this answer because it's a comment; 2. because it's a comment, post it as a comment under the best answer; 3. because you've found the best answer, you should accept it by clicking the checkmark to its left
Michael Haren
Unfortunately, I actually asked the question anonymously before I made a user account. If i can somehow 'claim' this this question, please let me know. Thanks!
Nate