Common CSPRNG Algorithms
What you'll learn: The most widely-used cryptographically secure pseudo-random number generator algorithms that power secure systems today.
The CSPRNG Landscape
Now that you understand what makes a CSPRNG secure (unpredictability, forward secrecy, backtracking resistance), let's explore the industry-standard algorithms actually used in production systems. Think of these as the "trusted brands" of randomness generation—each tested, standardized, and deployed across billions of devices.
Major CSPRNG Algorithms
AES-CTR-DRBG
Uses AES in counter mode as its core. The algorithm maintains an internal counter and encrypts it with AES to produce random output. Since AES is hardware-accelerated on modern processors, this is extremely fast and widely supported.
HMAC-DRBG
Built on HMAC (which you learned about earlier). It maintains an internal state and uses HMAC repeatedly to generate output. Because it only needs a hash function, it's highly portable and doesn't require special hardware.
Hash-DRBG
Similar to HMAC-DRBG but uses a hash function directly without HMAC's key mechanism. Slightly simpler but still cryptographically strong when implemented correctly.
ChaCha20-based Generators
Modern designs using the ChaCha20 stream cipher. These are gaining popularity in contemporary systems (like Linux's random number generator) because ChaCha20 is fast in software and resistant to timing attacks.
Choosing Between Them
All four meet CSPRNG requirements, so selection often depends on available hardware acceleration (AES instructions favor AES-CTR-DRBG) or platform constraints (hash-only environments prefer Hash-DRBG or HMAC-DRBG).
Key Takeaway: AES-CTR-DRBG, HMAC-DRBG, Hash-DRBG, and ChaCha20-based generators are the battle-tested CSPRNG algorithms powering secure randomness in modern systems—each offering different performance and portability trade-offs while maintaining cryptographic security.