CSPRNG

Difficulty: Advanced

Question

What is a CSPRNG and why use it for security tokens?

Answer

A Cryptographically Secure Pseudo-Random Number Generator. Standard `Math.random()` in JS is predictable; a CSPRNG (like `crypto.getRandomValues`) is not, making tokens un-guessable.

Concepts covered

Entropy, Randomness