ГСЧ randomness lab

Technology

Generator,
that is not shameful to show

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.

SHA-256 mixer 3 sources live test
Browser CSPRNG crypto.getRandomValues
Your movements coordinates, timings, taps
Public beacon drand #6588550
SHA-256 mixer seed = H(CSRNG ∥ pool ∥ beacon)
Stream of numbers CSPRNG ⊕ SHA-256 keystream
All tools numbers, coin, dice, choice

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

Why is this better than a single source

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.

01

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.

unpredictability
02

The entropy of your actions

Every 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 nature
03

Public beacon of chance

drand 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.

verifiability
Condition of the beacon drand #6588550
Randomness of the current round 0f7d976d30c7a36f92e71f4f56bf7c8ce575078557ddcdd20550cad01615fa5e
6588550 drand round
10:52:29 time of publication
32 entropy byte

You can check on the beacon server: https://api.drand.sh/public/6588550. The BLS signature is issued by a distributed committee — it cannot be forged alone.

Live entropy collection 30 %

Requesting the public randomness beacon…

CSPRNG Your movements Beacon

Verify

See for yourself: a test on 65,536 numbers

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.

Check result the test did not run
— values
— chi-square (255 df)
— p-value
— 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.

Comparison with a 'regular' generator

What exactly changes if you don't limit yourself to Math.random().

PropertyMath.random()Our generator
SourcePseudorandom, initialized onceCSPRNG + physical entropy + public beacon
PredictabilityWe will restore based on several valuesDoes not recover
VerifiabilityNoSigned drand rounds
Source offlineThere isCSPRNG + movements remain
Quality controlNoOpen statistical test
What is important to know
Mouse movements are processed locally: only a hash of the entropy pool remains in the browser. Neither coordinates nor history are sent to the server.
The mixing is arranged in such a way that even complete knowledge of the public beacon does not allow predicting the result: it is additionally mixed with the CSPRNG secret.
A generator is a tool for fair selection and entertainment. It is not gambling and not a lottery: bets are not accepted, prizes are not paid out.
Legal information
↑↓ navigation Enter to open Esc close