DRBG family

HMAC_DRBG

NIST SP 800-90A deterministic random bit generator built on HMAC

standard 1 variant NIST SP 800-90A Rev. 1, section 10.1.2

Overview

HMAC_DRBG is a deterministic random bit generator that expands seed entropy into a long stream of cryptographically secure pseudorandom bits using HMAC. It is one of the three DRBG mechanisms approved in NIST SP 800-90A and is valued for its simple design and conservative security argument.

The generator keeps two secret values, a key K and a chaining value V. Its update function mixes new input into K and V with a few HMAC calls. To generate output, it repeatedly sets V = HMAC(K, V) and emits V, then runs update again so that compromise of the state after a request does not reveal earlier outputs (backtracking resistance). Reseeding with fresh entropy after a set number of requests provides prediction resistance against an attacker who previously learned the state.

HMAC_DRBG is also the deterministic nonce generator inside RFC 6979 for ECDSA. SP 800-90A Rev. 1 removed the Dual_EC_DRBG mechanism after concerns about a backdoor, leaving HMAC_DRBG, Hash_DRBG and CTR_DRBG. The variant present is hmac-drbg-sha256. Compared with CTR_DRBG it is slower but simpler to analyse, with fewer subtle requirements around derivation functions. Each Generate call may return at most 2^19 bits, and SP 800-90A requires reseeding after at most 2^48 requests.

History

2006–2015
  1. HMAC_DRBG specified in NIST SP 800-90

  2. Retained in SP 800-90A Rev. 1 after Dual_EC_DRBG was removed

  3. Specified in NIST SP 800-90A Rev. 1 section 10.1.2

How it works

  1. Instantiate: set K = 0x00..., V = 0x01..., then update with entropy, nonce and personalisation string.
  2. Update: K = HMAC(K, V || 0x00 || data), V = HMAC(K, V), and repeat with 0x01 if data is present.
  3. Generate: iterate V = HMAC(K, V) to produce output, then update to roll the state forward.
  4. Reseed: mix in fresh entropy when the reseed counter limit is reached or on demand.

Security notes

Security depends entirely on the quality of the seed entropy; seed from the operating system RNG. The state must be protected and never duplicated (for example by forking or VM snapshots) without reseeding, or outputs will repeat.

Typical uses

Deterministic nonce generation for ECDSA (RFC 6979)FIPS-compliant random bit generationExpanding OS entropy for high-volume key generation

Variants in NextSSL

1
AlgorithmTierSizes (bytes)StandardsAPI
HMAC-DRBG-SHA-256
hmac-drbg-sha256
standard seed 32–1024 NIST SP 800-90A Rev. 1 section 10.1.2 safe

Frequently asked questions

Which HMAC_DRBG variants does NextSSL include?

NextSSL registers 1 HMAC_DRBG variant: hmac-drbg-sha256.