Entropy & Random / Random Generation
What you will do: Generate random bytes from Web Crypto, OpenSSL WASM, Math.random() and a linear congruential generator, and run the same statistical tests on each.
Worked example: Generate from the LCG source, then predict its next output from its internal state after generation — the prediction matches even though the LCG usually lands within range on the visual checks.
Runtime and privacy: The cryptographic exercise runs in this browser. Review the site privacy terms before entering sensitive material; use synthetic inputs for learning and evaluation.
Browse all Crypto Lab tools · Learn with Entropy & Randomness
For your role
- Developer / Engineer
- Generate from Web Crypto API and from Math.random() side by side: the first is the call your code should make for keys and nonces, the second is the one that must never be, and the panels show why.
- Security Architect
- The Production Entropy Sources section lists entropy-source products and, where one exists, the CMVP Entropy Validation Certificate that covers them (listed versions only); checking that evidence is where a key-generation design has to start.
- Researcher / Academic
- Generate 64 bytes from each source, Web Crypto API, OpenSSL WASM, Math.random() and Timestamp LCG, and compare them: the LCG output can be predicted from earlier bytes, yet it usually lands within range on the visual checks — a failure no output check shows.
- Certification & Validation Engineer
- The Production Entropy Sources section lists entropy-source products with the CMVP Entropy Validation Certificate that covers them, where one exists — read the version on the certificate before assuming it covers the part in your module.
- IT Ops / DevOps
- Use the four sources to see what a weak generator produces; the Production Entropy Sources list names the hardware and cloud entropy feeds to check for on your key-generating hosts.
Random Byte Generation
Compare cryptographically secure and insecure random sources side by side, and see why output that looks random can still be fully predictable.
Web Crypto API
OpenSSL WASM
Production Entropy Sources
Products marketed as entropy sources for DRBGs and HSMs. Where a CMVP Entropy Validation Certificate exists it is named (checked 2026-09-24); a certificate covers the listed versions only, and none of this is demonstrated by this workshop.
Secure sources (Web Crypto, OpenSSL) draw from the operating system's entropy pool (e.g., /dev/urandom). Insecure sources (Math.random, LCG) use deterministic algorithms with predictable seeds — their output looks random but is fully reproducible. An SP 800-90A DRBG is deterministic too: its output is only as unpredictable as its seed, which SP 800-90C expects to come from validated SP 800-90B entropy sources.
Next in sequence
Entropy Testing
Run the visual checks and the SP 800-90B health tests on a sample as separate groups, and see what neither group can tell you.
Try it
Generate 64 bytes from Timestamp LCG. Why can the next output be predicted?
Next step
Keep learning: PQC 101PQC 101 follows Entropy & Randomness, the module this tool practises, in the Foundations track.
Related content
Next in Entropy & Random