Software Securityhome
Fix a findingSearch
Glossary

CSPRNG

Cryptographically secure pseudorandom number generator

Its output cannot feasibly be predicted, even by someone who has seen earlier output, so it is the source for keys, nonces, salts, session IDs and reset tokens. Use the operating system’s generator through APIs such as Python’s secrets module or crypto.getRandomValues, never Math.random or a general-purpose random module.

Also called
cryptographically secure random number generator

Covered in

Practice: Insecure randomness lab: Generate unguessable API keys

Find your next answer

Type to search. Search runs in your browser.

Searches run in your browser, but the host can infer them from the index files they load. The address shows your search so you can bookmark or share it.