With the growing importance of personal information security, numerous methods have been proposed for data encryption. To ensure system safety, ciphers must be unpredictable and robust. In modern Rivest–Shamir–Adleman (RSA) encryption systems, two prime numbers are required for key generation, and their randomness and unpredictability are essential for security. In this study, we propose a secure system for generating the prime numbers used in RSA encryption. The inherent properties of chaotic systems are employed as a Pseudo Random Number Generator (PRNG), while a Ring Oscillator is utilized as a True Random Number Generator (TRNG). The Miller–Rabin algorithm is further applied to verify the primality of the numbers produced by the PRNG. The entire design is implemented on a Field Programmable Gate Array (FPGA) to achieve a fully hardware system.