A very commonly used (examples: HTTP digest auth/CHAP/Kerberos) authentication scheme is something that looks like:
Setup.
- Client and server both know a password $p$.
Authentication.
- Server sends a random challenge $\alpha$.
- Client computes $r = \text{KDF}(p || \alpha)$ and sends $r$ to the server.
- Server computes $r' = \text{KDF}(p || \alpha)$ and checks $r' \overset{?}{=} r$.
This scheme is also described in other questions (example). Now this scheme has the disadvantage that the server needs to know the plaintext password. Could we make a public-key-based scheme for challenge response authentication?
For example, we could use elliptic curve arithmetic:
Setup.
- Client has a secret password $p$ (with reasonable entropy) and from this derives a key $k$ using a hash function.
- The client computes $[k]P = Q_k$ and the server will store this value as the user's public key.
Authentication.
- Server sends a random challenge $Q_\alpha = [\alpha]P$.
- Client computes $Q_s = [k]Q_\alpha$ and sends $Q_s$ to the server.
- The server computes $Q_s' = [\alpha]Q_k$ and checks $Q_s' \overset{?}{=} Q_s$.
Does this scheme work? Why would most systems use HMAC-based scheme instead?