Entropy & Random / QRNG Demo

What you will do: Compare a simulated QRNG sample, a CSPRNG sample and a deliberately broken PRNG on the same visual checks and SP 800-90B health tests, shown as separate groups.

Worked example: Run the checks on all three samples: only the weak PRNG stands out, because the simulated QRNG and the CSPRNG are the same kind of output.

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

Researcher / Academic
Generate CSPRNG and Run the Checks on All Three Samples: the visual checks and the SP 800-90B health tests for the Simulated QRNG, the CSPRNG and the Weak PRNG sit side by side in separate groups, and the page states that the Simulated QRNG sample is produced by crypto.getRandomValues, not quantum hardware.
Curious Explorer
Press Run the Checks on All Three Samples and look at which source stands out: only the weak one does. The “quantum” sample here is simulated with ordinary computer randomness, and even a real quantum device could not be told apart from a good computer generator by these checks.

Simulation — no QRNG hardware involved. The “QRNG” sample below is generated on load (and on Try Another Sample) by the browser’s crypto.getRandomValues() — the same classical CSPRNG call the “CSPRNG” panel uses. It stands in for QRNG output so you can see the data flow and the tests; nothing here comes from a quantum device.

This tool compares three samples side by side: a simulated “QRNG” sample, a fresh sample from your browser's CSPRNG (Web Crypto API), and a deliberately broken weak PRNG. The first two are the same kind of output, so any difference in their results is sampling noise. The weak PRNG should visibly fail several tests, which shows what the tests can catch.

What this demo shows

  • Simple statistical tests catch grossly broken output, like the weak PRNG's.
  • Good output from different generators looks the same to these tests.

What it does not show

  • Anything about a real QRNG — no quantum device is involved.
  • How much entropy any source has. SP 800-90B estimates entropy from at least 1,000,000 raw noise-source samples, not from 64 or 128 bytes of final output.
  • That any source is validated or certified.
Sample Size:
Simulated

Simulated QRNG

crypto.getRandomValues() stand-in
2711862e 3c0bcbc1 c2aad818 82a2840a 4f4b50c6 2c0b72d0 b265be7a 590cdd0a b1d7dc3b 85560ab7 9c80e1fc b1c71b5b f8ac23c5 0d5bd729 18e1b1e9 e795a8d2
00
40
80
C0

CSPRNG (OS Entropy)

Browser Web Crypto API
No data yet — click Generate CSPRNG
Broken

Weak PRNG

Math.random() & 0x0F · high nibble forced to 0
0e0f020d 0802070f 070f060e 060c0000 0a0e000c 0d010a03 07060c00 080d0a0c 060b090d 0f0f070e 0105040e 0d0c060a 04090b0b 0c0b0c0b 070d000e 010c0a01
00
40
80
C0
Production Tool Capabilities & Verification Requirements

What this sample check establishes: Illustrates quantum random number generation (shot-noise / photon arrival / phase fluctuation) conditioning and entropy mixing with classical CSPRNGs.

Browser sandbox limitation (non-certification boundary): Simulates quantum noise distributions mathematically in the browser; no physical optical QRNG hardware is attached.

What to require and test in your production tools:

  • Entropy combination per SP 800-90C (RBG3(XOR)/RBG3(RS)) and CMVP IG D.O, where each source (including a QRNG) is itself SP 800-90B validated; a local OS/HSM source is a design choice, not a requirement.
  • Authenticated, integrity-protected transport if entropy is streamed from an external appliance over a network or PCIe bus.
  • Continuous SP 800-90B health tests (Repetition Count Test, Adaptive Proportion Test) on each raw source prior to conditioning.

Try it

  1. 1. Predict before you run it.
  2. 2. Run or change the tool above.
  3. 3. Explain what the result shows.

After Run the Checks on All Three Samples, how do the Simulated QRNG and the CSPRNG compare?

Next step

Keep learning: PQC 101

PQC 101 follows Entropy & Randomness, the module this tool practises, in the Foundations track.

Next in Entropy & Random