liveBook · Manning

Nonce

A nonce is a value intended for one-time use within a specified cryptographic, authentication, or authorization context.

How 4 Manning books explain it

Real-World Cryptography

A nonce is a value intended to distinguish cryptographic operations and, in signature generation, is typically required to be unique for each signature under a key.

How it is used
Uses nonces to separate cryptographic operations, generate keystreams, sequence transport records, sign messages, and search blockchain hashes.
How deep it goes
Explains nonce roles, sizes, counters, failure consequences, deterministic signing, misuse resistance, and proof-of-work without implementation-level derivations.
Examples
Uses AES-CTR diagrams, ChaCha20 state parameters, ECDSA’s k, TLS record counters, and an interactive Bitcoin blockchain.
What you can do after
Diagnose nonce misuse by checking uniqueness, secrecy, unpredictability, counters, and algorithm-specific documentation before deployment.

Read how Real-World Cryptography explains nonce →

Building Web APIs with ASP.NET Core

A script nonce is a cryptographically unpredictable token that authorizes a specific inline script under a content security policy.

How it is used
Authorizes one inline script under a Content-Security-Policy header during deployment testing.
How deep it goes
Defines the nonce, applies matching values in the policy and script element, and warns against production inline scripts.
Examples
Demonstrates a nonce in Program.cs for /cod/test and verifies the resulting JavaScript alert after redeployment.
What you can do after
Apply it via a Content-Security-Policy header and matching script attribute, then verify browser execution after redeployment.

Read how Building Web APIs with ASP.NET Core explains nonce →

Hacking Cryptography

A cryptographic nonce is a value intended to be used once to prevent identical cryptographic inputs from producing repeated protected outputs.

How it is used
Uses nonce uniqueness to secure ECDSA signing and to expose how faulty randomness compromises digital signatures.
How deep it goes
Derives nonce and private-key recovery, implements the failure in Go, and stops short of partial-nonce lattice attacks.
Examples
Demonstrates fixed-nonce Go signing, repeated r values, two-signature recovery, and verification of a newly forged signature.
What you can do after
Diagnose/debug with it by recognizing reused ECDSA nonces and tracing recovery of the nonce and private signing key.

Read how Hacking Cryptography explains nonce →

Software Security for Developers

A nonce is a value intended to be used only once within a specified cryptographic or authentication context.

How it is used
Protects OIDC authentication responses and cryptographic operations from replay through single-use values.
How deep it goes
Defines nonce use, explains request-to-token matching and IV reuse risks, but defers the mathematics of encryption-mode consequences.
Examples
Uses OIDC authentication responses, intercepted payment requests, and AES-CBC encryption of multiple files.
What you can do after
Apply it via OIDC validation and AES-CBC IV management to reject reused authentication data and avoid key-IV reuse.

Read how Software Security for Developers explains nonce →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.