CSPRNG

A cryptographically secure pseudorandom number generator: a source of random numbers that attackers cannot predict, used to create keys, nonces and salts.

In more detail

CSPRNG stands for cryptographically secure pseudorandom number generator. Operating systems provide one, seeded from hardware noise, and programming languages expose it through calls such as Python's secrets module or os.urandom. Ordinary random functions, such as Python's random module, are predictable and must never be used for security values.

Examples

secrets.token_bytes(32)
salts: use os.urandom(16) per user
openssl rand -hex 32 > db.key

Related terms

Taught in

References