Challenge-response authentication: how to prevent replay attacks
A verifier sends a challenge and checks a response made with an authenticatorʼs secret. Non-reuse and unpredictability are separate protocol requirements.
Challenge-response authentication: how to prevent replay attacks
Challenge-response authentication lets a verifier send a challenge and check a response made with a secret, showing control of that secret without sending it directly. Depending on the protocol, the response may use a shared-secret message authentication code or a private-key signature; WebAuthn is one public-key example. For protocols using a fresh challenge, bind the response to the request and do not repeat a nonce under the same key. NIST distinguishes this non-reuse rule from unpredictability: a nonce is not necessarily unpredictable. Follow the chosen standard, expire and consume challenges as specified, and check the expected account, service, origin, and session context. Replay resistance does not stop malware or every phishing attack. Use reviewed protocol libraries, not a custom login construction.
Sources
[NIST CSRC, Challenge-Response Protocol glossary](https://csrc.nist.gov/glossary/term/Challenge_Response_Protocol)
[NIST SP 800-63-4, Digital Identity Guidelines](https://pages.nist.gov/800-63-4/sp800-63.html)
[W3C Web Authentication Level 3](https://www.w3.org/TR/webauthn-3/)
[IETF RFC 2104, HMAC](https://www.rfc-editor.org/rfc/rfc2104.html)