Statistical testing of random number generators and their improvement using randomness extraction
Cameron Foreman, Richie Yeung, Florian J. Curchod
TL;DR
This study develops a tunable statistical testing environment (STE) for rigorous RNG evaluation, benchmarked on three widely used generators (32-bit LFSR, Intel RDSEED, IDQ Quantis) using multiple standard test suites. It introduces a four-tier randomness extraction hierarchy (deterministic, seeded, two-source, and physical device-independent) implemented via the Circulant extractor in Cryptomite, coupled with post-processing guided by min-entropy estimates. Across levels 2–4, post-processing significantly improves statistical properties, with level 4 leveraging semi-device-independent quantum protocols to certify additional entropy; however, some sources remain challenging due to intrinsic min-entropy limitations. The authors provide open-source access to STE and the extraction toolkit, demonstrating practical pathways to robust RNGs beyond standard certification tests and highlighting the limits of statistical testing in guaranteeing cryptographic unpredictability. These results have direct implications for designing and certifying cryptographic RNGs by combining diverse extraction paradigms with comprehensive, repeatable statistical testing.
Abstract
Random number generators (RNGs) are notoriously challenging to build and test, especially for cryptographic applications. While statistical tests cannot definitively guarantee an RNG's output quality, they are a powerful verification tool and the only universally applicable testing method. In this work, we design, implement, and present various post-processing methods, using randomness extractors, to improve the RNG output quality and compare them through statistical testing. We begin by performing intensive tests on three RNGs -- the 32-bit linear feedback shift register (LFSR), Intel's 'RDSEED,' and IDQuantique's 'Quantis' -- and compare their performance. Next, we apply the different post-processing methods to each RNG and conduct further intensive testing on the processed output. To facilitate this, we introduce a comprehensive statistical testing environment, based on existing test suites, that can be parametrised for lightweight (fast) to intensive testing.
