Take the 2-minute tour ×  tl;dr: I am wondering what the best
way is to check a password when the client does not trust the
server.  I know of two common ways servers can check if a user's
password is correct:    1. The server stores hash of password,
the client sends the password, and the server hashes the
password and compares hash with stored hash. If they match, the
password is correct.   2. The server stores the password in
plaintext, and generates a salt which it combines with the
password and hashes, and then sends the salt to the client. The
client hashes the password and salt, and sends that hash back.
The server compares the two hashes and if they match, the
password is correct.  However, both these methods require that
the client trusts the server, and the first one requires that
the connection be secure (while the second one obviously
doesn't).  I have thought of a way, but I don't know if it's
good since I don't have a background in cryptography, I don't
know what contortions can compromise secur