Nonces are often used to prevent replay attacks in networks. Because they are a one time use, any attacker replaying a request would be stopped because the nonce would be invalid.

However using nonces forces the serialisation of requests. Most web APIs are made to be usable concurrently.

Are there solutions that enable the usage of nonces and still allow concurrent requests?

I know that TLS is usually recommended so that replay attacks don't happen, so nonces aren't used. But I'm referring to situations where nonces still are used regardless of TLS.

One idea I had was to share a seed during an initial key exchange and that shared seed is used to generate nonces deterministically in lockstep between client and server. But I realised concurrent messages/requests may arrive at the server out of order.

  • $\begingroup$ Can you expand a bit more one "I know that TLS is usually recommended, so that replay attacks don't happen, so nonces aren't used"? afaik, the most used ciphersuite in TLS (1.3), e.g., GCM are nonce based AEAD. I would therefore say that nonces are prevalent in TLS. $\endgroup$ Jun 18, 2022 at 10:38
  • $\begingroup$ If you don't need Integerity, CTR mode is parallel. You can combine Parallel hash then apply MAC.... $\endgroup$
    – kelalaka
    Jun 18, 2022 at 13:55
  • $\begingroup$ Nonces don't necessarily have anything to do with replay attack prevention. Nonces prevent the outputs of two executions of a function from being identical even when all other inputs are identical. $\endgroup$ Jun 23, 2022 at 0:55


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.