Annals of the Academy of Romanian Scientists
Series on Engineering Sciences
ISSN 2066-8570 Volume 18, Number 2/2026
A SELF-REFRESHING TRUE-RANDOM NUMBER
GENERATOR
Gabriel VASILESCU
1
, Maria DIMA
2
, BEJINARIU
3
,
Augustin SEMENESCU
4
Rezumat. Prezentăm implementarea noastră a unei rutine autentice de „expandare” a
numerelor aleatoare, care se bazează pe o colecție restrânsă de 200.000 de valori fizice
provenite din zgomot atmosferic, cuprinse între 0 și 9.999, producând numere noi prin
combinarea a două intrări alese la un interval arbitrar, offset-ul fiind derivat printr-un
mecanism de registru de deplasare cu reacție care utilizează atât funcția standard rand(),
cât și intrări din însăși colecția, generând astfel rezultate „recurente, dar ne-ciclice”, fără
o perioadă identificabilă. Pentru a depăși limitarea inerentă a unui bazin finit de entropie,
introducem un mecanism dinamic de auto-reîmprospătare care înlocuiește periodic cele
mai vechi valori consumate cu loturi noi, autentic aleatoare, preluate automat din aceeași
sursă de zgomot atmosferic, reînsămânțând simultan generatorul de offset cu un hash al
datelor primite, asigurând astfel o aprovizionare infinită și continuă cu entropie; validarea
prin suita de teste DieHarder confirmă că generatorul își menține calitatea favorabilă a
aleatoriei pe durate arbitrar de lungi, cu un impact neglijabil asupra performanței.
Abstract. We report the design and test of a genuine random-number "expansion" routine,
which draws upon a collection of 200,000 physically sourced atmospheric-noise values
between 0 and 9,999, producing fresh numbers by merging entries sampled at arbitrary
intervals, with offsets derived via a feedback shift-register mechanism using both the
standard rand() function and entries from the pool itself, thereby generating non-cyclic
outcomes with no identifiable period. To overcome the inherent limitation of a finite
entropy pool, we introduce a dynamic self-refreshing mechanism that periodically replaces
the oldest consumed values with newly acquired true-random batches-fetched
automatically from the same atmospheric-noise source-while simultaneously re-seeding
the offset generator with a hash of the incoming data, ensuring an infinite, continuously
renewed entropy supply; validation through the DieHarder test suite confirms that the
1
Senior Researcher I, Habil. PhD, Eng., National Institute for Research and Development in Mine
Safety and Protection to Explosion, Chief Laboratory of Explosives Materials and Pyrotechnic
Articles INCD INSEMEX of Petrosani, Petrosani, Romania (e-mail:
dragos.vasilescu@insemex.ro).
2
Doctoral School - University of Petrosani, Petrosani, Romania (e-mail: mstsds@proton.me).
3
Professor, PhD, Eng., Materials Engineering and Industrial Safety Department, Faculty of Materials
Science and Engineering, Vice Dean, Gheorghe Asachi Technical University of Iasi, Iasi, Romania
(e-mail: costica.bejinariu@academic.tuiasi.ro).
4
Professor, PhD, Eng. Mat. Ec.,National Science and Technology University Politehnica Bucharest,
Bucharest, Romania, Member of Academy of Romanian Scientists; (e-mail:
augustin.semenescu@upb.ro).
75
76 Gabriel Vasilescu, Maria DimaBejinariu, Augustin Semenescu
generator maintains its favorable randomness quality over arbitrarily long runs, with
negligible performance overhead.
Keywords: true random number generator, atmospheric noise, dynamic refreshing
DOI 10.56082/annalsarscieng.2026.2.75
1. Introduction
The generation of high-quality random numbers underpins applications from Monte
Carlo simulations to cryptographic key distribution [1], with hash-function-based
pseudo-random generators like RANLUX and Mersenne Twister offering a trade-
off between statistical rigor and speed [2]; however, these approaches suffer from
vulnerabilities including distributional biases, correlations, and degraded
uniformity [3, 2], as illustrated by fitting errors that force dataset discards in high-
energy physics, motivating hardware-based True Random Number Generators
(TRNGs) that derive entropy from physical phenomena [5-7].
In response, we introduced in our previous work [4] a true-random "multiplier"
algorithm that expanded a finite pool of 200,000 atmospheric-noise values from
random.org [8] via digit-wise pairing with offsets from a feedback shift-register,
generating non-repetitive sequences with no known period and passing the
DieHarder test suite [9-11].
The finite pool limits long-running simulations and cryptographic applications, so
we now propose a dynamic self-refreshing mechanism that continuously
replenishes consumed entropy with fresh batches from the same atmospheric source
[8] while re-seeding the offset generator with a cryptographic hash, ensuring an
infinite entropy supply without compromising performance - a contribution that
extends our prior work to arbitrary durations and establishes a new class of hybrid
generators combining physical authenticity with software flexibility, with statistical
quality comparing favorably to leading commercial TRNGs [12, 13].
2. Digit Intertwining Method
Figure 1 - two random numbers are chosen to produce another random number [4]
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),
78 Gabriel Vasilescu, Maria DimaBejinariu, Augustin Semenescu
2. inserting them at to overwrite the oldest elements and advancing
,
3. re-seeding the rand() state atomically via SHA-256 hash of the batch to
couple offsets to physical entropy, and
4. continuing normal operation with advancing through a mixture of old and
fresh data.
4. Results
To validate the integrity of the self-refreshing generator, we subjected its output to
the same battery of statistical tests applied to the original multiplier [4], namely the
distribution flatness test, the Fourier spectral analysis, and the comprehensive
DieHarder test suite.
The objective was twofold: first, to confirm that the refresh mechanism introduces
no artifacts or biases into the generated sequences; and second, to demonstrate that
the statistical quality of the output remains indistinguishable from that of the
original finite-pool implementation, thereby establishing that the enhancement
achieves its goal of infinite entropy supply without compromising randomness.
Figure 2 - the histogram of 
generated numbers, showing a flat distribution with bin
counts fluctuating statistically around the theoretical mean - confirming the uniformity
and randomness of our output across the unit interval.
A Self-Refreshing True-Random Number Generator 79
The distribution test on 
outputs showed a flat histogram with statistical
fluctuations following the predicted
scaling, with no boundary artifacts even at
finer resolutions (Figure 2).
Fourier analysis of

consecutive samples revealed only broadband noise with no
periodic peaks, and spectra remained unchanged across multiple refresh cycles,
confirming the absence of transient artifacts (Figure 3).
Finally, the DieHarder suite (114 tests) on 
numbers yielded 112 p-values
within the expected 󰇟󰇠 range. The two borderline results are statistically
expected (1.14 failures at 1% significance), matching the original multiplier's
performance and confirming equivalence, while the absence of systematic failures
(unlike gcc rand()) validates our physical-entropy design (Figure 4).
Only one weak component visible in the DieHarder test suite, which is not relevant
as even True Random Numbers (perfect random numbers) can fail sometimes at
one of the RGB tests, aspect that has been mentioned in the DieHarder manual [11].
Figure 3 - Fourier Spectral Analysis - presents the Fourier power spectrum of

outputs, showing flat broadband noise without periodic peaks
80 Gabriel Vasilescu, Maria DimaBejinariu, Augustin Semenescu
Figure 4 - Dieharder test - 
permutations, which can fail also at true random numbers, according to the DieHarder
manual [11]
A Self-Refreshing True-Random Number Generator 81
Conclusions
We reported a dynamic self-refreshing enhancement to our previous true-random
number multiplier algorithm [4], which overcomes the fundamental finite-pool
limitation by implementing a circular buffer that continuously replenishes
consumed entropy with freshly acquired atmospheric-noise batches, while
simultaneously re-seeding the offset generator with a cryptographic hash of the
incoming data. The validation was done through distribution flatness tests, Fourier
spectral analysis, and the comprehensive DieHarder test suite, which confirms that
the refreshed generator preserves the statistical quality of the original, passing all
tests. This enhancement transforms a finite-expansion device into an effectively
infinite true-random stream, making it suitable for long-running Monte Carlo
campaigns, cryptographic infrastructures, and other applications requiring
sustained access to genuine randomness, while establishing a general paradigm for
hybrid true-random generation that combines physical entropy sources with
software-based expansion.
R E F E R E N C E S
[1] I. H. Priyanka and A. Khalique, "Random number generators and their applications: A
Review", Int. J. Res. Electron. Comp. Eng. 7, 17771781 (2019).
[2] P. L. Ecuyer, "Random number generators and empirical tests", Monte Carlo and Quasi-
Monte Carlo Methods, Austria, 1996, Lecture Notes in Statistics, Vol. 127 (Springer, New York,
1998).
[3] L. Thomas, "One-time pad", Trends in Data Protection and Encryption Technologies (2023),
pp. 36.
[4]            
Physics of Particles and Nuclei Letters, 22, no. 5, pp. 1036-1040, DOI:
[10.1134/S1547477125701043]
[5]             
Mathematics and Computational Science (Springer, 2014), pp. 275315. DOI: [10.1007/978-3-319-
10683-0_12]
[6] V. Mannalath, S. Mishra, and A. Pathak, "A comprehensive review of quantum random
number generators: Concepts, classification and the origin of randomness", Quantum Inf. Process.
22, 439 (2023). DOI: [10.1007/s11128-023-04162-9]
82 Gabriel Vasilescu, Maria DimaBejinariu, Augustin Semenescu
[7] M. Moeini, M. Akbari, M. Mirsadeghi, H. R. Naeij, N. Haghkish, A. Hayeri, and M.
Malekian, "Quantum random number generator based on LED", J. Appl. Phys., 135, 084402 (2024).
DOI: [10.1063/5.0188208]
[8] Atmospheric Noise from https://random.org
[9] DieHarder test suite. https://webhome.phy.duke.edu/~rgb/General/dieharder/dieharder.html
[10] Swiss Federal Office for Metrology-METAS, Random Number Generation-Certification
(passed Dieharder test). https://www.idquantique.com/random-number-generation/certifications/
[11] Dieharder manual-what is a 3D Sphere test & it can fail at one of RGB test even if it's perfect.
https://rurban.github.io/dieharder/manual/dieharder.pdf
[12] Intel's RdRand server.
[13] https://www.intel.com/content/www/us/en/partner/showcase/offering/a5b3b000-
00000zqRAAA/xip8001b-true-random-number-generator-trng-ip-core.html
[14] Quantique random number generator. https://www.idquantique.com/random-number-
generation/products/quantis-random-number-generator/