Abstract
Ensuring information security heavily relies on high-quality random sequences for encryption keys. Physical entropy sources, despite their use in generating true random sequences, are susceptible to environmental disturbances, necessitating real-time randomness testing to maintain high entropy. However, existing methods for generating test data for real-time randomness testers face significant challenges, including producing sequences that fail to meet specific randomness criteria, constructing borderline sequences with slight non-randomness, and addressing the difficulty of simultaneously violating multiple randomness criteria. This paper introduces a dynamic test data generation framework designed to address these challenges. The framework leverages evolutionary algorithm (EA) to transform the generation of borderline sequences into a multi-constrained optimization problem, where a large language model (LLM) acts as a dynamic parameter adjuster. By analyzing evolutionary trends in population statistics and interacting with evolutionary dynamics through a game-theoretic mechanism, the LLM adaptively adjusts scaling factors and weight coefficients, mitigating the curse of dimensionality in multi-objective optimization and enabling real-time parameter tuning. The experimental results also highlight the high quality of the generated sequences: our approach can generate borderline test data that slightly fail to satisfy the target randomness criteria, yet exhibit statistical properties very similar to those of high-entropy sources under standard test suites. These borderline sequences are fault-detectable and provide challenging, realistic test inputs for classical statistical-test-based real-time randomness testers.
Data availability
Not all data is presented in this article; for brevity, only the most relevant results have been included. Additional data or details are available upon reasonable request by contacting the corresponding author.
References
Fischer, V. et al. True random number generators in configurable logic devices. Project ANR-ICTeR 23–28 (2009).
Von Neumann, J. et al. Various techniques used in connection with random digits. Collected Works 5, 768–770 (1963).
Park, J. et al. 16.8 a 60mb/s trng with pvt-variation-tolerant design based on str in 4nm. In 2024 IEEE International Solid-State Circuits Conference (ISSCC), 67, 310–312 (IEEE, 2024).
Foreman, C., Yeung, R. & Curchod, F. J. Statistical testing of random number generators and their improvement using randomness extraction. Entropy 26, 1053 (2024).
Sönmez Turan, M. et al. Recommendation for the entropy sources used for random bit generation (Tech. Rep, National Institute of Standards and Technology, 2016).
Bassham, L. E. et al. A statistical test suite for random and pseudorandom number generators for cryptographic applications. NIST (2010).
MARSAGLIA, G. The marsaglia random number cdrom including the diehard battery of tests of randomness (home page). http://www.csis.hku.hkdiehard/cdrom/ (2008).
L’ecuyer, P. & Simard, R. Testu01: Ac library for empirical testing of random number generators. ACM Trans. Math. Softw. 33, 1–40 (2007).
Huang, Y., Fan, F., Huang, C., Yang, H. & Gu, M. Ma-dg: learning features of sequences in different dimensions for min-entropy evaluation via 2d-cnn and multi-head self-attention. IEEE Trans. Inf. Forensics Secur. (2024).
Kelsey, J., McKay, K. A. & Sönmez Turan, M. Predictive models for min-entropy estimation. In International Workshop on Cryptographic Hardware and Embedded Systems, 373–392 (Springer, 2015).
Brown, K. H. Security requirements for cryptographic modules. Fed. Inf. Process. Stand. Publ 1–53 (1994).
OSCCA. Cryptographic server test specifications. Tech. Rep. GM/T 0059-2019, OSCCA (2018).
Cai, X. & Zhang, C. An innovative differentiated creative search based on collaborative development and population evaluation. Biomimetics 10, 260 (2025).
Li, N. & Wang, H. Variable filtered-waveform variational mode decomposition and its application in rolling bearing fault feature extraction. Entropy 27, 277 (2025).
Qi, Z., Fei, Y., Chao, Z., Dong, Z. & Wang, H. Blotter: Block-based lossless compression for highway structural health monitoring data. Future Generat.Comput. Syst. 108003 (2025).
Gao, Y. et al. A bi-level hybrid game framework for stochastic robust optimization in multi-integrated energy microgrids. Sustain. Energy Grids Netw. 102024 (2025).
Wen, P. et al. Multiobjective optimization of a pressure maintaining ball valve structure based on rsm and nsga-II. Sci. Rep. 15, 21342 (2025).
He, W. et al. A deep reinforcement learning approach to time delay differential game deception resource deployment. IEEE Trans. Dependable Secure Comput. (2025).
Guo, J. et al. An online optimization escape entrapment strategy for planetary rovers based on Bayesian optimization. J. Field Robot. 41, 2518–2529 (2024).
Li, J. et al. Outlier detection using iterative adaptive mini-minimum spanning tree generation with applications on medical data. Front. Physiol. 14, 1233341 (2023).
Zhang, Z. et al. Optimization of low-power femtosecond laser trepan drilling by machine learning and a high-throughput multi-objective genetic algorithm. Opt. Laser Technol. 148, 107688 (2022).
Yan, Z., Hao, P., Nardello, M., Brunelli, D. & Wen, H. A generalizable load recognition method in nilm based on transferable random forest. IEEE Trans. Instrument. Measure. (2025).
Chen, Y., Li, H., Song, Y. & Zhu, X. Recoding hybrid stochastic numbers for preventing bit width accumulation and fault tolerance (Regular Papers, IEEE Transactions on Circuits and Systems I, 2024).
Marsaglia, G. The marsaglia random number cdrom including the diehard battery of tests of randomness. http://www.stat.fsu.edu/pub/diehard/ (2008).
Hamburg, M., Kocher, P. & Marson, M. E. Analysis of intel’s ivy bridge digital random number generator. http://www.cryptography.com/public/pdf/Intel/TRNG/Report/20120312.pdf (2012).
Jun, B. & Kocher, P. The intel random number generator. white paper, cryptography research inc (1999).
Tsoi, K. H., Leung, K. H. & Leong, P. H. W. High performance physical random number generator. IET Comput. Digit. Tech. 1, 349–352 (2007).
Williams, C. R., Salevan, J. C., Li, X., Roy, R. & Murphy, T. E. Fast physical random number generator using amplified spontaneous emission. Opt. Express 18, 23584–23597 (2010).
Sun, Y. & Lo, B. Random number generation using inertial measurement unit signals for on-body iot devices. In Living in the Internet of Things: Cybersecurity of the IoT-2018, 28 (IET, 2018).
Xu, B. et al. High speed continuous variable source-independent quantum random number generation. Quant. Sci. Technol. 4, 025013 (2019).
Ó Dúill, S. et al. Operation of an electrical-only-contact photonic integrated chip for quantum random number generation using laser gain-switching. Optics4, 551–562 (2023).
Jacak, M. M., Jóźwiak, P., Niemczuk, J. & Jacak, J. E. Quantum generators of random numbers. Sci. Rep. 11, 16108 (2021).
Keshavarzian, P. et al. A 3.3-gb/s spad-based quantum random number generator. IEEE J. Solid-State Circ.58, 2632–2647 (2023).
Crocetti, L., Nannipieri, P., Di Matteo, S., Fanucci, L. & Saponara, S. Review of methodologies and metrics for assessing the quality of random number generators. Electronics 12, 723 (2023).
Biebighauser, D. Testing random number generators. University of Minnesota 15 (2000).
Zia, U., McCartney, M., Scotney, B., Martinez, J. & Sajjad, A. A resource efficient pseudo random number generator based on sawtooth maps for internet of things. Secur. Privacy 6, e304 (2023).
Syta, E. et al. Scalable bias-resistant distributed randomness. In 2017 IEEE Symposium on Security and Privacy (SP), 444–460 (IEEE, 2017).
Bhuyan, M. H., Bhattacharyya, D. K. & Kalita, J. K. Network anomaly detection: methods, systems and tools. IEEE Commun. Surv. Tutor. 16, 303–336 (2013).
Agrawal, U. K., Panda, N., Tejani, G. G. & Mousavirad, S. J. Improved salp swarm algorithm-driven deep cnn for brain tumor analysis. Sci. Rep. 15, 24645 (2025).
Çelik, E. et al. Novel distance-fitness learning scheme for ameliorating metaheuristic optimization. Eng. Sci. Technol. Int. J. 65, 102053 (2025).
Çelik, E. et al. Reconfigured single-and double-diode models for improved modelling of solar cells/modules. Sci. Rep. 15, 2101 (2025).
Wen, J. et al. Virtual sample generation for small sample learning: a survey, recent developments and future prospects. Neurocomputing 128934 (2024).
Pan, Y., Liu, X., Liao, X., Cao, Y. & Ren, C. Random sub-samples generation for self-supervised real image denoising. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 12150–12159 (2023).
Cui, C., Tang, J. & Xia, H. Virtual sample generation based on regression enhanced generative adversarial network. In 2024 36th Chinese Control and Decision Conference (CCDC), 2244–2248 (IEEE, 2024).
Pan, Y., Liu, X., Liao, X., Cao, Y. & Ren, C. Random sub-samples generation for self-supervised real image denoising. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 12150–12159 (2023).
Tobin, J. et al. Domain randomization and generative models for robotic grasping. In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 3482–3489 (IEEE, 2018).
Deb, K. Genetic algorithm in search and optimization: the technique and applications. In Proceedings of International Workshop on Soft Computing and Intelligent Systems,(ISI, Calcutta, India), 58–87 (Proceedings of International Workshop on Soft Computing and Intelligent ..., 1998).
Opara, K. R. & Arabas, J. Differential evolution: A survey of theoretical analyses. Swarm Evol. Comput. 44, 546–558 (2019).
Wang, J., Wang, W.-C., Hu, X.-X., Qiu, L. & Zang, H.-F. Black-winged kite algorithm: a nature-inspired meta-heuristic for solving benchmark functions and engineering problems. Artif. Intell. Rev. 57, 98 (2024).
Marini, F. & Walczak, B. Particle swarm optimization (pso). a tutorial. Chemom. Intell. Lab. Syst. 149, 153–165 (2015).
Shehab, M. et al. Harris hawks optimization algorithm: variants and applications. Arch. Comput. Methods Eng. 29, 5579–5603 (2022).
Xue, J. & Shen, B. Dung beetle optimizer: A new meta-heuristic algorithm for global optimization. J. Supercomput. 79, 7305–7336 (2023).
Pierezan, J. & Coelho, L. D. S. Coyote optimization algorithm: a new metaheuristic for global optimization problems. In 2018 IEEE Congress on Evolutionary Computation (CEC), 1–8 (IEEE, 2018).
Vrana, G., Lou, D. & Kuang, R. Raw qpp-rng randomness via system jitter across platforms: a nist sp 800-90b evaluation. Sci. Rep.. https://doi.org/10.1038/s41598-025-13135-8 (2025).
Program, N. C. M. V. Entropy source validation report for id quantique–certificate e.63. Tech. Rep., National Institute of Standards and Technology (2020). (accessed 08 May 2025).
Program, N. C. M. V. Entropy source validation report for microchip ecc608 nrbg–certificate e.46. Tech. Rep., National Institute of Standards and Technology (2023). (accessed 08 May 2025).
Program, N. C. M. V. Entropy source validation report for quside pcie one–certificate e.178. Tech. Rep., National Institute of Standards and Technology (2024). (accessed 08 May 2025).
Program, N. C. M. V. Entropy source validation report for quintessencelabs q5 rtx–certificate e.54. Tech. Rep., National Institute of Standards and Technology (2024) (accessed 08 May 2025).
Funding
This work is supported by the National Natural Science Foundation of China (No. 62172251).
Author information
Authors and Affiliations
Contributions
P.G. and Z.W conceived the experiment(s), P.G. and B.Z. conducted the experiments, P.G. and C.L. analysed the results. All authors reviewed the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Gao, P., Zhang, B., Wang, Z. et al. Generating borderline test samples for randomness testers via intelligent optimization and evolutionary algorithms. Sci Rep (2026). https://doi.org/10.1038/s41598-026-38020-w
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-026-38020-w