# How to use salt if I am sending hashed password?

If have application that is sending username and hashed password to server for authentication, how would I use salt for this scenario ?

-

2. Compute the expensive salted hash on the client, send to server
3. Server performs a cheap unsalted hash(or HMAC) on the hash received from the client and compares with the stored value

Note that sending a hashed password doesn't mean you can use an insecure transport. You still need proper transport security, such as SSL/TLS/HTTPS or a specialized password verification protocol such as SRP.

-
Step 3 is essential, do not skip it. –  David Schwartz Apr 14 '13 at 13:36
The secure transport is important, too – otherwise while your password is safe, it actually doesn't protect anything, if the attacker can modify the message's contents. –  Paŭlo Ebermann Apr 14 '13 at 14:31
For step 1 if username is unrecognized I should send random salt so it is not used for username probing ? Step 3: in database password is stored twice hashed, once with salt and than hash that result once more unsalted ? –  IvanP Apr 14 '13 at 20:54
@IvanP 1. If you want to avoid username probing, you can return HMAC(FakeSaltKey, username). A random value isn't possible since for real users the salt will not change often. 3. There is only a single stored value Hash(SaltedHash(salt, password)). –  CodesInChaos Apr 14 '13 at 21:42
That is exactly what I meant. Thanks. –  IvanP Apr 14 '13 at 22:21