Towards Generation of Secure Pseudorandom Prime Dataset Using Generative Adversarial Networks and The Learning Parity with Noise Problem
-
https://doi.org/10.14419/9bppfw31
Received date: November 10, 2025
Accepted date: December 10, 2025
Published date: December 17, 2025
-
Cryptography; Generative Adversarial Networks; Learning Parity with Noise; Prime Dataset; Pseudorandom Number Generator -
Abstract
At present, prime numbers are an essential part of online security for secure key generation and digital signatures due to their unpredictabil-ity and resistance to factorization attacks, which has led to considerable interest in research on distributions of primes, especially prime gaps and hidden patterns. Traditional prime analytical methods lack structural insight at the scale of cryptographic systems. This has led to greater interest in applying machine learning (ML) techniques to prime analysis. However, due to a lack of publicly available high-quality datasets, the evaluation of prime behavior using ML is often impeded. Furthermore, current prime generation techniques tend to become computationally inefficient when scaled to produce large quantities of high-bit-length prime numbers. In response, this paper proposes a novel generative pipeline, GANLPN, that leverages Generative Adversarial Networks (GANs) combined with the Learning Parity with Noise (LPN) problem to generate bulk primes that are cryptographically secure. In this way, a publicly accessible dataset of 1,115,000 1024-bit primes has been generated. The generated sequences passed all NIST SP800-22 statistical randomness tests with better inference time and throughput. The present work outlines a path for future ML-assisted studies of prime patterns, gaps, distributions, and the presence of weak keys in cryptography.
-
References
- H. Lashkari et al., “Enhancing Computational Efficiency of Network Reliability with a New Prime Shortest Path Algorithm,” vol. 13, p. 109, 2025, https://doi.org/10.3390/technologies13030109.
- Y. G. Narayana and V. Yegnanarayanan, “On Prime number varieties and their applications,” Engineering and Applied Science Letters, vol. 3, no. 3, pp. 30–36, Dec. 2020, https://doi.org/10.30538/psrp-easl2020.0045.
- S. Sarna and R. Czerwinski, “Small prime divisors attack and countermeasure against the rsa-otp algorithm,” Electronics (Switzerland), vol. 11, no. 1, Jan. 2022, https://doi.org/10.3390/electronics11010095.
- J. A. Solinas, “Generalized Mersenne Prime,” in Encyclopedia of Cryptography, Security and Privacy, Cham: Springer Nature Switzerland, 2025, pp. 1002–1004. https://doi.org/10.1007/978-3-030-71522-9_32.
- R. Bogotyrev, “Number theory and its applications in cybersecurity: a review,” Annals of Mathematics and Computer Science, vol. 25, pp. 64–77, Nov. 2024, https://doi.org/10.56947/amcs.v25.370.
- B. Y. Wang and X. Wang, “Symmetrical Distribution of Primes and Their Gaps,” Advances in Pure Mathematics, vol. 11, no. 05, pp. 447–456, 2021, https://doi.org/10.4236/apm.2021.115031.
- J. E. Cohen, “Gaps Between Consecutive Primes and the Exponential Distribution,” Exp Math, vol. 34, no. 2, pp. 260–269, Apr. 2025, https://doi.org/10.1080/10586458.2024.2362348.
- P. Shiu, “Distribution of Prime Numbers,” in Number Theory with Computations, Springer, 2024, pp. 235–269. https://doi.org/10.1007/978-3-031-63814-5_9.
- D. Lattanzi, “Statistical Distributions of Prime Number Gaps,” Journal of Advances in Mathematics and Computer Science, vol. 39, no. 1, pp. 36–61, Jan. 2024, https://doi.org/10.9734/jamcs/2024/v39i11861.
- W. Banks, K. Ford, and T. Tao, “Large prime gaps and probabilistic models,” Invent Math, vol. 233, no. 3, pp. 1471–1518, Sep. 2023, https://doi.org/10.1007/s00222-023-01199-0.
- G. Iovane, E. Benedetto, and C. Gallo, “Multiscale Sieve for Smart Prime Generation and Application in Info-Security, IoT and Blockchain,” Ap-plied Sciences (Switzerland), vol. 14, no. 19, Oct. 2024, https://doi.org/10.3390/app14198983.
- A. Ezz-Eldien et al., “Computational challenges and solutions: Prime number generation for enhanced data security,” PLoS One, vol. 19, no. 11, p. e0311782, Nov. 2024, https://doi.org/10.1371/journal.pone.0311782.
- B. Tran and S. Vaudenay, “Solving the Learning Parity with Noise Problem Using Quantum Algorithms,” in International Conference on Cryptolo-gy in Africa, Springer, 2022, pp. 295–322. https://doi.org/10.1007/978-3-031-17433-9_13.
- M. Wang, G. Huang, H. Gao, and L. Hu, “Improved Zero-Knowledge Proofs for Commitments from Learning Parity with Noise,” in 2022 IEEE International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom), IEEE, Dec. 2022, pp. 415–421. https://doi.org/10.1109/TrustCom56396.2022.00064.
- I. Papadakis, “Representation and Generation of Prime and Coprime Numbers by Using Structured Algebraic Sums,” Mathematics and Computer Science, vol. 9, no. 3, pp. 57–63, Aug. 2024, https://doi.org/10.11648/j.mcs.20240903.12.
- M. Loconsole and L. Regolin, “Are prime numbers special? Insights from the life sciences,” Biol Direct, vol. 17, no. 1, p. 11, Dec. 2022, https://doi.org/10.1186/s13062-022-00326-w.
- J. Sorenson and J. Webster, “An algorithm and computation to verify Legendre’s conjecture up to $$7cdot 10^{13}$$,” Res Number Theory, vol. 11, no. 1, p. 4, Mar. 2025, https://doi.org/10.1007/s40993-024-00589-4.
- M. Ghidarcea and D. Popescu, “Classic Linear Sieves Revisited,” Journal of Control Engineering and Applied Informatics, vol. 26, no. 4, pp. 3–14, Dec. 2024, https://doi.org/10.61416/ceai.v26i4.9098.
- H. M. Bahig, M. A. G. Hazber, K. Al-Utaibi, D. I. Nassr, and H. M. Bahig, “Efficient Sequential and Parallel Prime Sieve Algorithms,” Symmetry (Basel), vol. 14, no. 12, p. 2527, Nov. 2022, https://doi.org/10.3390/sym14122527.
- V. Umadevi and K. Sivakami, “Comparison and Performance Evaluation of Prime Number Generation Using Sieves Algorithm,” J Comput Theor Nanosci, vol. 17, no. 4, pp. 1839–1841, Apr. 2020, https://doi.org/10.1166/jctn.2020.8450.
- A. M. Zaki, M. E. Bakr, A. M. Alsahangiti, S. K. Khosa, and K. A. Fathy, “Acceleration of Wheel Factoring Techniques,” Mathematics, vol. 11, no. 5, p. 1203, Mar. 2023, https://doi.org/10.3390/math11051203.
- C. Fei, X. Zhang, D. Wang, H. Hu, R. Huang, and Z. Wang, “EPRNG: Effective Pseudo-Random Number Generator on the Internet of Vehicles Using Deep Convolution Generative Adversarial Network,” Information, vol. 16, no. 1, p. 21, Jan. 2025, https://doi.org/10.3390/info16010021.
- S. H. AbdELHaleem, S. K. Abd-El-Hafiz, and A. G. Radwan, “Analysis and Guidelines for Different Designs of Pseudo Random Number Gener-ators,” IEEE Access, vol. 12, pp. 115697–115715, 2024, https://doi.org/10.1109/ACCESS.2024.3445277.
- M. De Bernardi, M. H. R. Khouzani, and P. Malacaria, “Pseudo-Random Number Generation Using Generative Adversarial Networks,” in Joint European Conference on Machine Learning and Knowledge Discovery in Databases, Springer, 2019, pp. 191–200. https://doi.org/10.1007/978-3-030-13453-2_15.
- R. Oak, C. Rahalkar, and D. Gujar, “Poster,” in Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, New York, NY, USA: ACM, Nov. 2019, pp. 2597–2599. https://doi.org/10.1145/3319535.3363265.
- H. Kim, Y. Kwon, M. Sim, S. Lim, and H. Seo, “Generative Adversarial Networks-Based Pseudo-Random Number Generator for Embedded Pro-cessors,” in International Conference on Information Security and Cryptology, Springer, 2021, pp. 215–234. https://doi.org/10.1007/978-3-030-68890-5_12.
- K. Okada, K. Endo, K. Yasuoka, and S. Kurabayashi, “Learned pseudo-random number generator: WGAN-GP for generating statistically robust random numbers,” PLoS One, vol. 18, no. 6 June, Jun. 2023, https://doi.org/10.1371/journal.pone.0287025.
- X. Wu, Y. Han, S. Zhu, Y. Li, S. Cui, and X. Wang, “Learned Pseudo-Random Number Generator Based on Generative Adversarial Networks,” in International Conference on Frontiers in Cyber Security, Springer, 2024, pp. 517–530. https://doi.org/10.1007/978-981-99-9331-4_34.
- X. Wu, Y. Han, M. Zhang, Y. Li, and S. Cui, “GAN-based pseudo random number generation optimized through genetic algorithms,” Complex & Intelligent Systems, vol. 11, no. 1, p. 31, Jan. 2025, https://doi.org/10.1007/s40747-024-01606-w.
- A. Ünal, “Worst-Case Subexponential Attacks on PRGs of Constant Degree or Constant Locality,” in Annual International Conference on the The-ory and Applications of Cryptographic Techniques, Springer, 2023, pp. 25–54. https://doi.org/10.1007/978-3-031-30545-0_2.
- A. Kumar and A. Mishra, “Evaluation of Cryptographically Secure Pseudo Random Number Generators for Post Quantum Era,” in 2022 IEEE 7th International conference for Convergence in Technology (I2CT), IEEE, Apr. 2022, pp. 1–5. https://doi.org/10.1109/I2CT54291.2022.9824543.
- R. Biswas, D. R. Talukdar, and U. Roy, “Exploring the Limits of Classical Random Number Generation and Unveiling Quantum Alternatives,” in International Conference on Network Security and Blockchain Technology, Springer, 2025, pp. 35–45. https://doi.org/10.1007/978-981-97-8051-8_4.
- Y. Zhang, X. Lu, Y. Liu, Y. Yin, and K. Wang, “LEAP: High-Performance Lattice-Based Pseudorandom Number Generator,” IACR Transactions on Symmetric Cryptology, vol. 2025, no. 3, pp. 151–182, Sep. 2025, https://doi.org/10.46586/tosc.v2025.i3.151-182.
- A. Saini, A. Tsokanos, and R. Kirner, “Quantum Randomness in Cryptography—A Survey of Cryptosystems, RNG-Based Ciphers, and QRNGs,” Information, vol. 13, no. 8, p. 358, Jul. 2022, https://doi.org/10.3390/info13080358.
- C. Ryan, M. Kshirsagar, G. Vaidya, A. Cunningham, and R. Sivaraman, “Design of a cryptographically secure pseudo random number generator with grammatical evolution,” Sci Rep, vol. 12, no. 1, Dec. 2022, https://doi.org/10.1038/s41598-022-11613-x.
- H. Halpin, “The adversary: the philosophy of cryptography,” J Cybersecur, vol. 11, no. 1, 2025, https://doi.org/10.1093/cybsec/tyaf006.
- S. Senouci, S. A. Madoune, M. R. Senouci, A. Senouci, and Z. Tang, “A novel PRNG for fiber optic transmission,” Chaos Solitons Fractals, vol. 192, p. 116038, Mar. 2025, https://doi.org/10.1016/j.chaos.2025.116038.
-
Downloads
-
How to Cite
Asiedu, D., Mensah, P. K. ., Appiahene, P. ., & Nimbe, P. . (2025). Towards Generation of Secure Pseudorandom Prime Dataset Using Generative Adversarial Networks and The Learning Parity with Noise Problem. International Journal of Basic and Applied Sciences, 14(8), 382-398. https://doi.org/10.14419/9bppfw31
