3 ms·
> Facebook, and any other company you'll log in to, requires a non-hashed password at some point to check against the hash. You need a cleartext password at som
by wtbob 12y ago
> Facebook, and any other company you'll log in to, requires a non-hashed password at some point to check against the hash. You need a cleartext password at some point, otherwise the user can't send anything to you.
No, they really don't need that. C.f. SRP (http://srp.stanford.edu/ http://srp.stanford.edu/) and similar protocols, where the end user performs a local calculation and the remote party is able to verify identity without ever knowing the password.
This could be the workflow:
1. User enters email address at site.
2. Site sends an email containing a URL with a 512-bit query parameter (yes, this means that user's ISP—and anyone else with access to the email—could sign in once). This parameter might be HMAC(secret, address), enabling the server to store no state for unverified users.
3. User visits URL, and sees a form for email address and password entry. There are hidden fields for the crypto parameters.
4. The user's browser takes the user's address and password, generates a random salt, and calculates a function of the crypto parameters and the local CSPRNG to get the salt a function of the address, password and crypto parameters to get the password verifier.
5. The user's browser POSTs (address, salt, verifier) to the server
Then whenever the user logs in, the browser and server engage in the SRP exchange.
The server never knows the client's password, ever. Nor is someone who knows the verifier able to forge the password.
The best practise is never to transmit sensitive data in the first place.