Cryptographic CSPRNG
crypto.getRandomValues() — the same source that protects TLS connections and key generation. It guarantees unpredictability: even knowing all the other layers, the result still cannot be computed.
unpredictabilityGenerators
Random Number GeneratorAny number in any range Coin FlipHeads or tails online Dice Rollerd4–d20 for tabletop games Lottery Numbers6/45, 5/36, KenoChoice
Random Pick from a ListPick a winner from names Fortune WheelSpin and let it choose Random TeamsSplit players into teams Magic 8 BallAsk a question, get an answerGiveaways
Prize GiveawayA draw you can verify Verify a GiveawayConfirm the fairnessA draw you can verify
Publish the hash before the start — anyone can recompute the result afterwards.
How it worksTechnology
Most websites write Math.random() and call it coincidence. We mix three independent sources of entropy through SHA-256 and show how to verify it.
If the external beacon is unavailable, the site does not break: there remain two independent sources — the cryptographic generator and the entropy of your actions.
Three layers
Each layer covers the weakness of the other. Together they provide what no single generator can give on its own: unpredictability, physical nature, and verifiability.
crypto.getRandomValues() — the same source that protects TLS connections and key generation. It guarantees unpredictability: even knowing all the other layers, the result still cannot be computed.
unpredictabilityEvery mouse movement, tap, and key press is coordinates with micron precision and timings with nanosecond variance. We hash them into a 256-bit pool, which is updated on every event. The data does not leave the browser.
physical naturedrand is a distributed network of independent organizations (Cloudflare, EPFL, Protocol Labs, etc.) that publishes a signed block of random data every few seconds. Anyone can verify the signature and make sure that the value has not been tampered with.
verifiabilityYou can check on the beacon server: https://api.drand.sh/public/6588556. The BLS signature is issued by a distributed committee — it cannot be forged alone.
Requesting the public randomness beacon…
Verify
Let's generate a large sample with the same generator that tools use, and check it with statistical criteria: byte uniformity (chi-square), bit balance, serial correlation.
Chi-square checks how uniformly the bytes of generated numbers are distributed. For 255 degrees of freedom, a value around 255 is considered normal; a p-value greater than 0.05 means that no deviations from randomness are statistically detected.
What exactly changes if you don't limit yourself to Math.random().
| Property | Math.random() | Our generator |
|---|---|---|
| Source | Pseudorandom, initialized once | CSPRNG + physical entropy + public beacon |
| Predictability | We will restore based on several values | Does not recover |
| Verifiability | No | Signed drand rounds |
| Source offline | There is | CSPRNG + movements remain |
| Quality control | No | Open statistical test |