Randomness validation

How to read statistical test results for a random generator

Statistical batteries can reveal bias, correlation, and structural defects in a stream. They are necessary evidence for a randomness core, but a pass is not a permanent certificate of unpredictability or implementation security.

Updated

Key points

  • Use multiple independent suites because each battery looks for different statistical weaknesses.
  • Preserve versions, parameters, sample sizes, and raw logs so another reviewer can understand the result.
  • Combine statistical testing with design review, secure seeding, failure handling, and production monitoring.

What the Rantropy core has been tested with

Rantropy retains internal summaries and excerpts from PractRand, ENT, Dieharder, NIST STS, and TestU01. A summary describes the retained sample or excerpt; it is not a signed public test report or certification of the current service build.

For example, the retained PractRand excerpt reports version 0.95, a stream length of 2^38 bytes (256 GiB), and no anomalies in 915 test results. The excerpt does not identify a source commit, binary checksum, or input checksum. Technical due diligence needs those links before attributing the result to a particular generator build.

A TestU01 subtest excerpt or a summary of extracted p-values does not establish that a complete BigCrush run finished. Ask for the final run summary, all warnings and failures, the input adapter, and the tested build alongside the raw output.

Why one battery is not enough

ENT is a compact profile and useful as an early check, but it is not a comprehensive certification. PractRand is effective at examining long streams and can expose issues as the sample grows. Dieharder and NIST STS provide collections of tests with their own parameter and interpretation rules. BigCrush applies a broad, demanding battery that can reveal defects missed by smaller checks.

A small number of unusual p-values can occur by chance when many tests are run. Review the suite guidance, repeated runs, clustering, and reproducibility before labelling an individual result a defect.

What statistical testing cannot prove

A stream can pass statistical tests while the system remains vulnerable because of a predictable seed, key exposure, state reuse, broken access control, or implementation mistakes. Conversely, deterministic output used for a reproducible simulation may be valid for that purpose even though it should never generate a security secret.

  • Review the generator construction and entropy source.
  • Test startup, restart, fork, scaling, and degraded-dependency behavior.
  • Protect keys and internal state and define rotation and incident procedures.
  • Pin build artifacts and preserve test logs with checksums.

Turn a test report into maintainable evidence

Record the source commit, build checksum, test tool version, command, parameters, platform, start and end time, and output checksum. Re-run the agreed suite when the core algorithm, compiler, entropy path, or deployment architecture changes. A customer or auditor then sees which software was tested rather than a detached screenshot.

  • Identify the exact generator build and entropy configuration used to produce the sample.
  • State whether the input is a continuous stream or a replayed file, with byte count, byte order, and any preprocessing.
  • Keep the complete output, exit status, interrupted runs, warnings, and repeat-run criteria.
  • Distribute report checksums through a trusted review channel and record who verified them.

Try file-integrity verification with an educational fixture

Download the example text and checksum file into the same directory, then run the command below on macOS or Linux with shasum available. The original file reports OK. Changing its bytes makes the check report FAILED and return a non-zero exit status.

This fixture is ordinary instructional text, not RNG output, a statistical test log, a service receipt, or a Merkle proof. It demonstrates only how to check file bytes against a reference checksum. It makes no claim about randomness quality, a Rantropy test result, or cryptographic security.

A checksum does not establish who created a report. Replacing both the file and its checksum can still produce OK. Obtain the reference checksum from a trusted source or use a separately verified signature when authenticity is required. The blank record template helps you collect the missing test context; filling it in does not certify a generator.

Check the downloaded example fileRun in the directory containing both example files. Expected result: rng-validation-integrity.example.txt: OK.Educational text fixtureReference checksumBlank test-context template
shasum -a 256 -c rng-validation-integrity.example.sha256

References and review sources

Review the evidence behind the generator

For technical due diligence, ask us for the relevant test scope, build context, and integration controls instead of relying on a pass label alone.

Request a technical review