Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Advertisement

Scientific Reports
  • View all journals
  • Search
  • My Account Login
  • Content Explore content
  • About the journal
  • Publish with us
  • Sign up for alerts
  • RSS feed
  1. nature
  2. scientific reports
  3. articles
  4. article
Generating borderline test samples for randomness testers via intelligent optimization and evolutionary algorithms
Download PDF
Download PDF
  • Article
  • Open access
  • Published: 04 February 2026

Generating borderline test samples for randomness testers via intelligent optimization and evolutionary algorithms

  • Peng Gao1,2,
  • Bin Zhang1 na1,
  • Ziyuan Wang3 na1 &
  • …
  • Chenglong Li2 

Scientific Reports , Article number:  (2026) Cite this article

We are providing an unedited version of this manuscript to give early access to its findings. Before final publication, the manuscript will undergo further editing. Please note there may be errors present which affect the content, and all legal disclaimers apply.

Subjects

  • Engineering
  • Mathematics and computing
  • Physics

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

  1. Fischer, V. et al. True random number generators in configurable logic devices. Project ANR-ICTeR 23–28 (2009).

  2. Von Neumann, J. et al. Various techniques used in connection with random digits. Collected Works 5, 768–770 (1963).

    Google Scholar 

  3. 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).

  4. Foreman, C., Yeung, R. & Curchod, F. J. Statistical testing of random number generators and their improvement using randomness extraction. Entropy 26, 1053 (2024).

    Google Scholar 

  5. 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).

  6. Bassham, L. E. et al. A statistical test suite for random and pseudorandom number generators for cryptographic applications. NIST (2010).

  7. MARSAGLIA, G. The marsaglia random number cdrom including the diehard battery of tests of randomness (home page). http://www.csis.hku.hkdiehard/cdrom/ (2008).

  8. L’ecuyer, P. & Simard, R. Testu01: Ac library for empirical testing of random number generators. ACM Trans. Math. Softw. 33, 1–40 (2007).

    Google Scholar 

  9. 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).

  10. 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).

  11. Brown, K. H. Security requirements for cryptographic modules. Fed. Inf. Process. Stand. Publ 1–53 (1994).

  12. OSCCA. Cryptographic server test specifications. Tech. Rep. GM/T 0059-2019, OSCCA (2018).

  13. Cai, X. & Zhang, C. An innovative differentiated creative search based on collaborative development and population evaluation. Biomimetics 10, 260 (2025).

    Google Scholar 

  14. Li, N. & Wang, H. Variable filtered-waveform variational mode decomposition and its application in rolling bearing fault feature extraction. Entropy 27, 277 (2025).

    Google Scholar 

  15. 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).

  16. 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).

  17. Wen, P. et al. Multiobjective optimization of a pressure maintaining ball valve structure based on rsm and nsga-II. Sci. Rep. 15, 21342 (2025).

    Google Scholar 

  18. He, W. et al. A deep reinforcement learning approach to time delay differential game deception resource deployment. IEEE Trans. Dependable Secure Comput. (2025).

  19. Guo, J. et al. An online optimization escape entrapment strategy for planetary rovers based on Bayesian optimization. J. Field Robot. 41, 2518–2529 (2024).

    Google Scholar 

  20. Li, J. et al. Outlier detection using iterative adaptive mini-minimum spanning tree generation with applications on medical data. Front. Physiol. 14, 1233341 (2023).

    Google Scholar 

  21. 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).

    Google Scholar 

  22. 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).

  23. 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).

  24. Marsaglia, G. The marsaglia random number cdrom including the diehard battery of tests of randomness. http://www.stat.fsu.edu/pub/diehard/ (2008).

  25. 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).

  26. Jun, B. & Kocher, P. The intel random number generator. white paper, cryptography research inc (1999).

  27. Tsoi, K. H., Leung, K. H. & Leong, P. H. W. High performance physical random number generator. IET Comput. Digit. Tech. 1, 349–352 (2007).

    Google Scholar 

  28. 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).

    Google Scholar 

  29. 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).

  30. Xu, B. et al. High speed continuous variable source-independent quantum random number generation. Quant. Sci. Technol. 4, 025013 (2019).

    Google Scholar 

  31. Ó 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).

  32. Jacak, M. M., Jóźwiak, P., Niemczuk, J. & Jacak, J. E. Quantum generators of random numbers. Sci. Rep. 11, 16108 (2021).

    Google Scholar 

  33. Keshavarzian, P. et al. A 3.3-gb/s spad-based quantum random number generator. IEEE J. Solid-State Circ.58, 2632–2647 (2023).

  34. 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).

    Google Scholar 

  35. Biebighauser, D. Testing random number generators. University of Minnesota 15 (2000).

  36. 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).

    Google Scholar 

  37. Syta, E. et al. Scalable bias-resistant distributed randomness. In 2017 IEEE Symposium on Security and Privacy (SP), 444–460 (IEEE, 2017).

  38. Bhuyan, M. H., Bhattacharyya, D. K. & Kalita, J. K. Network anomaly detection: methods, systems and tools. IEEE Commun. Surv. Tutor. 16, 303–336 (2013).

    Google Scholar 

  39. 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).

    Google Scholar 

  40. Çelik, E. et al. Novel distance-fitness learning scheme for ameliorating metaheuristic optimization. Eng. Sci. Technol. Int. J. 65, 102053 (2025).

    Google Scholar 

  41. Çelik, E. et al. Reconfigured single-and double-diode models for improved modelling of solar cells/modules. Sci. Rep. 15, 2101 (2025).

    Google Scholar 

  42. Wen, J. et al. Virtual sample generation for small sample learning: a survey, recent developments and future prospects. Neurocomputing 128934 (2024).

  43. 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).

  44. 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).

  45. 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).

  46. 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).

  47. 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).

  48. Opara, K. R. & Arabas, J. Differential evolution: A survey of theoretical analyses. Swarm Evol. Comput. 44, 546–558 (2019).

    Google Scholar 

  49. 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).

    Google Scholar 

  50. Marini, F. & Walczak, B. Particle swarm optimization (pso). a tutorial. Chemom. Intell. Lab. Syst. 149, 153–165 (2015).

    Google Scholar 

  51. Shehab, M. et al. Harris hawks optimization algorithm: variants and applications. Arch. Comput. Methods Eng. 29, 5579–5603 (2022).

    Google Scholar 

  52. Xue, J. & Shen, B. Dung beetle optimizer: A new meta-heuristic algorithm for global optimization. J. Supercomput. 79, 7305–7336 (2023).

    Google Scholar 

  53. 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).

  54. 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).

  55. 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).

  56. 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).

  57. 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).

  58. 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).

Download references

Funding

This work is supported by the National Natural Science Foundation of China (No. 62172251).

Author information

Author notes
  1. Bin Zhang and Ziyuan Wang have contributed equally to this work.

Authors and Affiliations

  1. Information Engineering University, Zhengzhou, 450001, China

    Peng Gao & Bin Zhang

  2. Institute for Network Sciences and Cyberspace, Tsinghua University, Beijing, 100084, China

    Peng Gao & Chenglong Li

  3. School of Computer Science and Technology, Nanjing University of Posts and Telecommunications, Nanjing, 210023, China

    Ziyuan Wang

Authors
  1. Peng Gao
    View author publications

    Search author on:PubMed Google Scholar

  2. Bin Zhang
    View author publications

    Search author on:PubMed Google Scholar

  3. Ziyuan Wang
    View author publications

    Search author on:PubMed Google Scholar

  4. Chenglong Li
    View author publications

    Search author on:PubMed Google Scholar

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

Correspondence to Chenglong Li.

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/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received: 12 September 2025

  • Accepted: 28 January 2026

  • Published: 04 February 2026

  • DOI: https://doi.org/10.1038/s41598-026-38020-w

Share this article

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

Keywords

  • Random number generation
  • Randomness testing
  • Genetic algorithm
  • Large language model
  • Multi-objective optimization
Download PDF

Advertisement

Explore content

  • Research articles
  • News & Comment
  • Collections
  • Subjects
  • Follow us on Facebook
  • Follow us on Twitter
  • Sign up for alerts
  • RSS feed

About the journal

  • About Scientific Reports
  • Contact
  • Journal policies
  • Guide to referees
  • Calls for Papers
  • Editor's Choice
  • Journal highlights
  • Open Access Fees and Funding

Publish with us

  • For authors
  • Language editing services
  • Open access funding
  • Submit manuscript

Search

Advanced search

Quick links

  • Explore articles by subject
  • Find a job
  • Guide to authors
  • Editorial policies

Scientific Reports (Sci Rep)

ISSN 2045-2322 (online)

nature.com sitemap

About Nature Portfolio

  • About us
  • Press releases
  • Press office
  • Contact us

Discover content

  • Journals A-Z
  • Articles by subject
  • protocols.io
  • Nature Index

Publishing policies

  • Nature portfolio policies
  • Open access

Author & Researcher services

  • Reprints & permissions
  • Research data
  • Language editing
  • Scientific editing
  • Nature Masterclasses
  • Research Solutions

Libraries & institutions

  • Librarian service & tools
  • Librarian portal
  • Open research
  • Recommend to library

Advertising & partnerships

  • Advertising
  • Partnerships & Services
  • Media kits
  • Branded content

Professional development

  • Nature Awards
  • Nature Careers
  • Nature Conferences

Regional websites

  • Nature Africa
  • Nature China
  • Nature India
  • Nature Japan
  • Nature Middle East
  • Privacy Policy
  • Use of cookies
  • Legal notice
  • Accessibility statement
  • Terms & Conditions
  • Your US state privacy rights
Springer Nature

© 2026 Springer Nature Limited

Nature Briefing AI and Robotics

Sign up for the Nature Briefing: AI and Robotics newsletter — what matters in AI and robotics research, free to your inbox weekly.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing: AI and Robotics