thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Security Fundamentals & Crypto · Advanced

Cryptographically Secure Pseudorandom Number Generator (CSPRNG)

Random number generator whose output is unpredictable enough for cryptographic use.

Definition

A CSPRNG passes statistical randomness tests and resists prediction even if some output is known. Examples include /dev/urandom on Linux, CryptGenRandom/BCryptGenRandom on Windows, and NIST SP 800-90A DRBGs. General-purpose PRNGs such as rand() must never be used for keys or tokens.

Example

Python's secrets.token_bytes(32) uses the OS CSPRNG to create a session token.

Exam tip

Standard library random functions are predictable; use a CSPRNG or hardware RNG.

Related terms