A Self-Refreshing True-Random Number Generator 77
The fundamental challenge confronting any physically sourced random number
generator is the small volume problem: while atmospheric noise - as harvested by
services such as random.org [8] - constitutes an excellent source of genuine, non-
deterministic randomness, the quantity of obtainable data is severely constrained
by practical considerations, and in our particular implementation we retrieved only
200,000 true-random integers uniformly distributed across , a collection
sufficient for modest tasks, but for large-scale Monte Carlo campaigns or
cryptographic applications is required sustained randomness over extended
durations.
To circumvent this volume constraint while retaining authentic randomness, we
devised an expansion routine - termed the "multiplier" and detailed in our previous
work [4] - whose core principle rests upon combining pairs of elements drawn from
the existing finite set, such that the number of accessible combinations grows as the
square of the pool size, yielding approximately
distinct pairings (a five-
order-of-magnitude increase).
Naive strategies like simple summation or multiplication introduce severe
distortions (triangular or skewed profiles), so our solution instead operates at the
digit level, exploiting the decimal representation of each true-random integer by
permuting the eight constituent digits of a pair (
) and
according to a pseudo-random order supplied by the local rand() function - a digit-
wise interleaving that preserves empirical digit frequencies while destroying
positional correlations and effectively "scrambling" inputs without biasing the
aggregate distribution - after which we normalize the resulting integer to the unit
interval , rendering the output suitable for direct incorporation into standard
simulation frameworks.
3. Dynamic Self-Refreshing Mechanism
While the multiplier algorithm expands the initial entropy pool by five orders of
magnitude, it remains bounded by its finite 200,000-integer source - a constraint
negligible for short simulations but critical for long-running or cryptographic
applications where recycling introduces correlations.
So our proposed enhancement replaces the static pool with a circular buffer: a
contiguous array of unsigned integers with a read pointer
and write pointer advancing monotonically with wraparound, maintaining a
minimum separation of elements, such that when fewer than
unrefreshed elements remain, a refresh cycle is triggered.
This cycle proceeds asynchronously by
1. acquiring a batch of fresh integers from random.org (with
timeout/retry and fallback to /dev/urandom),