Home/Glossary/Cryptographically secure PRNG

Glossary · Probability

Cryptographically secure PRNG

A cryptographically secure PRNG is a generator whose output an attacker cannot distinguish from true randomness, so past values give no better than chance at guessing the next one and the internal state stays infeasible to recover.

Cryptographically secure PRNG, in full

Category
Probability
Also called
CSPRNG, Cryptographically secure random number generator
In the glossary
All 75 terms, A–Z

A worked example

The same idea with real numbers attached.

Roll the d20 tool twice and the two results are unrelated, because each roll pulls four fresh bytes from the browser's Web Crypto pool and keeps nothing that would link them. Compare that with the daily numbers page, where the entire output is a function of one short seed string and can be reproduced by hand from the date. Different job, different generator, and the difference is deliberate.

Sources

Every dated or checkable claim above, with where it came from.

See also

The terms that sit closest to this one.

Where it comes up on this site

Cryptographically secure PRNG: frequently asked

Unpredictability under attack. Any amount of previous output must leave an adversary no better off than guessing at the next value, and the internal state must stay unrecoverable from what has been observed. Passing statistical randomness tests is necessary and nowhere near sufficient.

Yes. It is the Web Crypto interface to the platform's cryptographic generator, seeded from operating-system entropy, and the specification asks implementations to make it cryptographically strong. Math.random carries no such requirement.

Every roll, through rollInt. Nothing is seeded, and no result exists before you press the button.

More probability terms

The rest of the vocabulary

Lottery mechanics, probability, numerology and astrology, defined in one A–Z.

Open the glossary