Home

Nonces

A nonce is a value used only once in cryptographic communications to ensure freshness and protect against replay attacks. The term is a contraction of "number used once" and can refer to a random, unpredictable value or a monotonically increasing counter, depending on the protocol.

In practice, nonces are combined with other data such as a shared key, username, timestamp, or message

Common applications include challenge-response authentication, where a server issues a nonce and a client responds with

Important distinctions: a nonce is not a secret, and its primary properties are uniqueness and, in some

Implementation considerations include choosing an appropriate generation method (cryptographically secure randomness or strict counters), ensuring freshness

to
produce
a
unique
input
for
authentication,
encryption,
or
integrity
checks.
A
nonce
is
typically
not
secret;
its
value
must
be
known
to
both
communicating
parties
but
should
not
be
reused
with
the
same
key.
a
hash
that
includes
the
nonce;
and
in
transport
protocols
like
TLS,
where
nonces
help
derive
session
keys.
In
blockchain
networks
using
proof-of-work,
miners
repeatedly
modify
a
value
called
the
nonce
in
the
block
header
until
the
header
hash
meets
a
target.
cases,
unpredictability;
a
nonce
is
different
from
a
salt
(which
prevents
precomputation
of
hashes)
and
from
an
initialization
vector
(which
ensures
distinct
ciphertexts).
within
the
same
key,
and
securely
storing
nonces
when
necessary
to
avoid
reuse.
Reuse
with
the
same
key
can
undermine
security.