NIST SP 800-90A
NIST SP 800-90A is a publication from the U.S. National Institute of Standards and Technology (NIST) that specifies deterministic random bit generators (DRBGs). A DRBG is an algorithm that takes a short secret starting value, called a seed, and stretches it into a long stream of bits that look random.[1] Software uses such bits to make cryptographic keys, nonces, and authentication challenges.[2]
The current version, Revision 1, was written by Elaine Barker and John Kelsey and published in June 2015.[3] It defines three generators. Hash_DRBG is built on a hash function, which turns any input into a short, fixed-length digest. HMAC_DRBG is built on HMAC, a keyed hash function, and CTR_DRBG is built on a block cipher, which encrypts fixed-size blocks of data under a secret key. Earlier versions also had a fourth generator, Dual_EC_DRBG, which NIST removed after public concern that it could contain a backdoor.[4]
What a DRBG does
There are two basic ways to make random bits.[1]
| Type | How it makes bits | Kind of generator |
|---|---|---|
| Non-deterministic random bit generator (NRBG) | Measures an unpredictable physical process | A true or hardware random number generator |
| Deterministic random bit generator (DRBG) | Computes bits with an algorithm from a seed | A pseudorandom number generator |
NIST describes the standard's generators as a way to make cryptographically secure random numbers.[5]
Because a DRBG is an algorithm, the same seed always gives the same output. The output is unpredictable only if the seed is kept secret and contains enough entropy (unpredictability). Even then, it is unpredictable only up to a level the standard calls the security strength.[1]
For this reason, a full DRBG pairs the algorithm, called a DRBG mechanism, with a randomness source that supplies the seed.[1]
The standard names two guarantees for the case where an attacker learns the generator's current state.[1] Backtracking resistance keeps earlier outputs secret. Prediction resistance keeps later outputs secret, which needs a reseed (mixing fresh entropy into the state).
Two systems that talk to each other do not need to use the same DRBG, because random number generation does not require them to work together.[1] Each system can choose the mechanism that best fits its hardware and software.
The SP 800-90 series
SP 800-90A is one of three NIST documents that together describe a complete random bit generator.[1]
- SP 800-90A specifies the DRBG mechanisms, the algorithms that turn a seed into output.
- SP 800-90B covers how to design and validate entropy sources, the parts that collect unpredictability. Its final version came out in January 2018.[6]
- SP 800-90C covers how to combine a randomness source and a DRBG mechanism into a full generator. NIST published its final version in September 2025.[7]
Inputs and internal state
Inputs
A DRBG mechanism takes up to four kinds of input.[1]
- Entropy input: secret bits from the randomness source. They must contain at least as much entropy as the security strength of the instance (one running copy of the DRBG with its own stored state).
- Nonce: a value that almost never repeats, such as a fresh random value, a timestamp, or a counter. It must contain at least half the security strength in entropy, or repeat no more often than a random string of that many bits would.
- Personalization string: an optional but recommended string that sets one instance apart from others, such as a device serial number or an application ID.
- Additional input: optional bits the caller can supply when the DRBG reseeds or when it asks for output. The DRBG does not rely on these bits for its security.
The standard measures entropy as min-entropy, a worst-case measure of how hard a value is to guess.[1] The entropy input does not have to be perfectly random. A longer input is fine as long as its total entropy meets the requirement.
Internal state
The internal state is the DRBG's memory.[1] It holds a working state and some administrative data.
The working state contains the secret values derived from the seed and a count of requests since the last seeding.[1] The administrative data includes the security strength and whether prediction resistance is allowed.
The internal state must be protected at least as well as the outputs it will produce.[1] Each instance has its own internal state, and no other instance may use it.
The five functions
Every mechanism in the standard is built around five functions.[1]
- Instantiate: collect entropy input, combine it with a nonce and a personalization string to form a seed, and build the first internal state.
- Generate: return the requested pseudorandom bits and move the internal state forward for the next request.
- Reseed: mix fresh entropy input, plus any additional input, into the current state. This function is optional.
- Uninstantiate: erase the internal state (the standard calls this zeroizing).
- Health test: check that the mechanism still works correctly.
Each seed starts a seed period, which lasts until the next reseed or until the instance is no longer used.[1] One instance can serve several purposes. In that case it must be instantiated at the highest security strength that any of those purposes needs.
Security strength
A security strength of S bits means that breaking the system should take roughly basic operations.[1] SP 800-90A supports four strengths: 112, 128, 192, and 256 bits. A generator designed for a given maximum strength can be instantiated at that strength or at any lower one.
The bits returned by one request are only as strong as the smaller of two values:[1]
Here the output length is the number of bits returned, and the DRBG security strength is the strength set at instantiation. Joining the outputs of several requests does not raise the strength. Two 128-bit outputs from a 128-bit DRBG do not make a string with 256-bit strength.
The three mechanisms
The three mechanisms use different building blocks and have different limits.[1] The table lists the main values from the standard, and its last column is NIST's estimate of the main work needed for each output block. AES is the Advanced Encryption Standard, a block cipher, and TDEA is three-key Triple DES, an older block cipher.
| Mechanism | Building block | Secret state | Max bits per request | Max requests between reseeds | Main cost per block |
|---|---|---|---|---|---|
| Hash_DRBG | Approved hash function, such as SHA-256 | V and C, each 440 or 888 bits | 2 hash calls | ||
| HMAC_DRBG | HMAC with an approved hash function | Key and V, each one hash output long | 4 hash calls | ||
| CTR_DRBG (AES) | AES-128, AES-192, or AES-256 | Key and a 128-bit block V | 1 AES encryption | ||
| CTR_DRBG (TDEA) | Three-key Triple DES | Key and a 64-bit block V | 1 TDEA encryption |
In the CTR_DRBG rows, . Here ctr_len is the length of the counter field in bits and blocklen is the cipher's block length.[1]
NIST suggests choosing the mechanism that reuses a building block the system already has.[1] For example, a module that makes digital signatures with RSA, a public-key system, already has a hash function, so Hash_DRBG or HMAC_DRBG is a natural choice. A module that already encrypts with AES can use CTR_DRBG without trusting any new algorithm.
Hash_DRBG
Hash_DRBG runs a hash function in a way similar to counter mode.[1] Its secret state is a value V and a constant C, each seedlen bits long, where seedlen is the seed length in bits. Seedlen is 440 bits for SHA-1, SHA-224, SHA-512/224, SHA-256, and SHA-512/256, and 888 bits for SHA-384 and SHA-512, the larger members of the SHA-2 family.
To instantiate, it joins the entropy input, nonce, and personalization string into seed material.[1] It runs this through Hash_df, a derivation function (a hash-based function that mixes its input into a value of the needed length), to get V. It then sets , where means joining bit strings.
To answer a request for n bits, it hashes a run of counter values that starts at V:[1]
The output is the leftmost n bits of , where outlen is the length of one hash output.[1]
Before returning, the mechanism updates V:[1]
Here reseed_counter is the number of requests since the last seeding, and 0x03 is a one-byte prefix. If the caller supplies additional input, V first has added to it.[1]
HMAC_DRBG
HMAC_DRBG builds everything from HMAC.[1] Its secret state is a key K and a value V, each as long as one hash output. An internal Update function mixes data into the state:
- If the data is not empty, repeat both steps with the byte 0x01 instead of 0x00.
Instantiation sets K to all zero bytes and V to all 0x01 bytes, then runs Update on the seed material.[1]
To answer a request, the mechanism first runs Update with the additional input, if the caller supplied any.[1] It then repeats and outputs each new V until it has enough bits. Finally it runs Update again with the same additional input, which may be empty.
CTR_DRBG
CTR_DRBG runs an approved block cipher in counter mode: it encrypts a run of counter values and outputs the results.[1] The approved ciphers are AES with 128-, 192-, or 256-bit keys and three-key Triple DES (TDEA).
The secret state is a key and a counter block V.[1] Seedlen equals the block length plus the key length, which gives 256, 320, or 384 bits for AES and 232 bits for TDEA.
If the caller supplies additional input, the mechanism first turns it into seedlen bits and runs an Update function with it.[1] Then, for each output block, it adds 1 to V and outputs , the encryption of V under the key. After the request, it runs Update again with the additional input, or with zeros if there was none.
Update encrypts more counter values to get seedlen bits, combines them with the provided data using XOR, and splits the result into a new key and a new V.[1]
CTR_DRBG may skip its derivation function, Block_Cipher_df, only if its randomness source gives full-entropy output.[1] Full-entropy output is output in which every bit is fully unpredictable, a practical stand-in for ideal random bits.
Without the derivation function, no separate nonce is used.[1] The personalization string and additional input can then be at most seedlen bits.
Revision 1 also lets the counter fill only part of V, as long as it is at least 4 bits long.[1]
Reseeding and seed life
Every seed has a limited life, measured in the number of requests it serves.[1] When an instance reaches its limit, it must not give any more output until it has been reseeded. Reseeding can happen in four ways:
- The calling application asks for it.
- The caller requests prediction resistance.
- The generate function finds that the seed life has run out.
- An outside event triggers it, such as new entropy becoming available.
NIST prefers reseeding to starting a new instance.[1] Suppose the randomness source fails without anyone noticing. A properly seeded instance that reseeds from it keeps its earlier entropy, but a new instance seeded from it would not have enough.
An instance must never reseed itself.[1] An implementation without a reseed function must uninstantiate the instance when its seed life ends.
Security properties
The standard defines two guarantees for the case where an attacker learns the internal state at some moment.[1] Both assume the attacker cannot do as much work as the security strength implies.
Backtracking resistance
Backtracking resistance means that learning the current state does not help the attacker with earlier outputs.[1] The attacker can neither tell past outputs from random bits nor recover earlier states. A generator can provide this by making each step a one-way function, a function that is easy to compute but infeasible to reverse.
The standard says all its mechanisms were designed to provide backtracking resistance.[1] One later analysis disputes this for one way of using HMAC_DRBG (see Security analysis).
Prediction resistance
Prediction resistance means that learning the current state does not help the attacker with later outputs.[1] An algorithm alone cannot provide this, because an attacker who knows the state can run the algorithm forward. The only way is to reseed with fresh entropy, at least equal to the security strength, between requests.
This needs access to an entropy source or an NRBG.[1] NIST strongly recommends using prediction resistance as often as practical when an entropy source is available.
Health tests and validation
An implementation must test itself to show that it still works as designed.[1]
- Known-answer tests run each function on fixed inputs whose correct output is already known. They must run before first use, for example at power-on.
- The generate function should also be tested again at reasonable intervals that the implementer chooses.
- A failed test puts the DRBG into an error state with no output. Leaving that state needs user action, such as a power cycle, and the DRBG must then be instantiated again.
Formal conformance testing, which checks whether an implementation follows the standard, happens through NIST's Cryptographic Module Validation Program and Cryptographic Algorithm Validation Program.[1] A cryptographic module that contains a DRBG must be validated under FIPS 140. The standard also lists the documents an implementer must supply, such as the entropy method and the supported security strengths.
Turning bits into numbers
Applications often need a random integer from 0 to , not just random bits. A method has bias if it makes some results more likely than others. An appendix of the standard gives three ways to make such an integer:[1]
- Simple discard: draw just enough bits to write , and start over if the value is or more. This gives no bias, but the time it takes varies.
- Complex discard: choose a small count t and draw m bits, where m is the bit length of . If the value is below , split it into t base-r digits, each a number from 0 to ; otherwise start over. When many numbers are needed, it may perform better than simple discard, and NIST recommends choosing the smallest t for which is close to 1.
- Simple modular: draw at least 64 more bits than needed and reduce the result modulo r. It can run in constant time, meaning it takes the same time whatever value it draws, and its bias is so small it can be ignored.
History
SP 800-90 (2005 to 2012)
NIST developed SP 800-90 alongside American National Standard X9.82, and many of the same DRBGs appear in X9.82 Part 3.[1] NIST published a draft on 16 December 2005 that specified four generators, one of them Dual_EC_DRBG.[8] NIST finished the first version in June 2006 and revised it in March 2007 and August 2008.[1]
In January 2012, the document was published again as SP 800-90A, replacing SP 800-90 Revision 1.[9] That version offered generators based on hash functions, block ciphers, and number-theoretic problems. Dual_EC_DRBG was the number-theoretic one.
The Dual_EC_DRBG controversy
Dual_EC_DRBG was based on elliptic curves and used two fixed curve points, P and Q.[8] Whoever had generated P and Q could take one output and predict all later outputs. The main events were these:
- While the guideline was being written, cryptographers spotted this possible weakness. NIST first dealt with it by letting users generate their own points.[4]
- In August 2007, in a session of short informal talks at the CRYPTO 2007 conference, Microsoft researchers Dan Shumow and Niels Ferguson described the possible back door.[8]
- In 2013, news reports on leaked classified documents raised concern that the algorithm held a backdoor. On 10 September 2013, NIST reopened the SP 800-90 series for public comment and recommended that Dual_EC_DRBG no longer be used.[4]
- In April 2014, NIST released a draft that removed it, citing a lack of public confidence, and said it did not plan to allow any transition period.[4]
Bernstein, Lange, and Niederhagen point out that the standard still recommended the default points, and that FIPS validation required them.[8] They also report John Kelsey's account that the NSA said it had made P and Q "in a secure, classified way".
Revision 1 (2015)
NIST published SP 800-90A Revision 1 in June 2015, without Dual_EC_DRBG.[10] The three remaining mechanisms carried over from earlier versions, and NIST still considered them secure. Other changes added options for CTR_DRBG, such as a partial counter field, and recommended adding fresh randomness as often as practical.
Revision 2
On 4 September 2025, NIST announced that it plans a second revision and opened a comment period that closed on 4 November 2025.[5] The plans include:
- better alignment with the upcoming revision of SP 800-90C;
- a new DRBG built on extendable-output functions, specifically the SHAKE functions in FIPS 202;
- fixes for technical comments received since 2015.
In 2026, NIST's publication list still showed Revision 2 at the pre-draft stage.[6]
Security analysis
NIST's design arguments
The standard explains what each mechanism's security rests on.[1]
- Hash_DRBG is secure if the hash function behaves like a random oracle, an ideal random function. It has known problems if it starts with too little entropy and the rest arrives later as additional input. These problems go away when it is instantiated with the required entropy.
- HMAC_DRBG assumes that HMAC with the chosen hash is a pseudorandom function. This asks less of the hash function than Hash_DRBG does.
- For CTR_DRBG, any attack that respects the output limits is also an attack on the block cipher itself.
The CTR_DRBG output limits exist because of a distinguishing attack described by Matthew Campagna.[1] A distinguishing attack tries to tell a generator's output apart from truly random bits. Within one request, counter mode never repeats an output block, but truly random bits sometimes would.
For AES, an attacker who sees the largest output the limits allow, bits, has a chance of telling the output from random bits.[1] NIST calls this attack theoretical, with no practical threat to real use.
Formal proofs
In a 2019 Eurocrypt paper, Joanne Woodage and Dan Shumow noted that the three remaining mechanisms had received "surprisingly patchy" analysis, despite wide use.[11] They proved, in the random oracle model, that Hash_DRBG and HMAC_DRBG are robust, a strong property that covers both backtracking and prediction resistance.
For HMAC_DRBG, this proof holds only when additional input is used.[11] Without it, they showed, HMAC_DRBG does not even reach forward security, a weaker property close to backtracking resistance: earlier outputs stay secret after the state leaks. This contradicts the standard's claim that all its mechanisms resist backtracking.
Implementation risks
The same paper argued that the standard's flexibility allows risky choices.[11] A single generate request may produce many blocks, so an attacker who learns part of the state partway through a request may recover outputs they never saw. The authors found such choices in the OpenSSL and mbed TLS implementations of CTR_DRBG, though their attacks were theoretical.
Side-channel attacks
In 2020, Shaanan Cohney and colleagues showed practical side-channel attacks on CTR_DRBG.[12] They found that the design lacks forward security against an attacker who reads the state through a side channel, so earlier outputs can be exposed.
They also found that OpenSSL's FIPS module and the NetBSD kernel used an AES implementation that leaks through the processor cache.[12] Using this, they recovered TLS keys in test settings.
Formal verification
Researchers have also machine-checked an implementation of HMAC_DRBG.[13] They proved in the Coq proof assistant that the mbed TLS code matches a formal specification and that its output is pseudorandom.
Approval status
NIST's transition guidance, SP 800-131A Revision 2, sets the approval status of each generator for U.S. federal use.[2]
| Generator | Status |
|---|---|
| Hash_DRBG and HMAC_DRBG | Acceptable with any hash function in FIPS 180 or FIPS 202 (SHA-3) |
| CTR_DRBG with AES-128, AES-192, or AES-256 | Acceptable |
| CTR_DRBG with three-key TDEA | Disallowed after 31 December 2023 |
| Dual_EC_DRBG | Disallowed |
References
- Recommendation for Random Number Generation Using Deterministic Random Bit Generators (SP 800-90A Rev. 1), NIST, 2015.
- Transitioning the Use of Cryptographic Algorithms and Key Lengths (SP 800-131A Rev. 2), NIST, 2019.
- NIST SP 800-90A Rev. 1 publication page, NIST Computer Security Resource Center, 2015.
- NIST SP 800-90 Historical Information, NIST Computer Security Resource Center, 2016.
- SP 800-90A Rev. 2, Pre-Draft Call for Comments, NIST Computer Security Resource Center, 2025.
- Random Bit Generation: Publications, NIST Computer Security Resource Center, 2026.
- Recommendation for Random Bit Generator Constructions: NIST Publishes SP 800-90C, NIST, 2025.
- Dual EC: A Standardized Back Door (Bernstein, Lange, Niederhagen), Cryptology ePrint Archive, 2015.
- NIST SP 800-90A (Withdrawn), NIST Computer Security Resource Center, 2012.
- ITL Bulletin for August 2015: Recommendation for Random Number Generation Using Deterministic Random Bit Generators, NIST, 2015.
- An Analysis of the NIST SP 800-90A Standard (Woodage and Shumow; Eurocrypt 2019), Cryptology ePrint Archive, 2018.
- Pseudorandom Black Swans: Cache Attacks on CTR_DRBG (IEEE Symposium on Security and Privacy 2020), Cryptology ePrint Archive, 2019.
- Verified Correctness and Security of mbedTLS HMAC-DRBG, arXiv, 2017.
