A system for generating a prime number comprising: a pseudorandom number generator (PRNG) module and a prime number generator (PNG) module , wherein the PNG module is configured to: obtain a pseudorandom number from the PRNG module ; determine a big odd number denoted as PP according to the pseudorandom number, wherein a bit-size of PP is 1024 bit; execute primality test on PP; and determine PP as the output prime number in response to PP passing the primality test; wherein the determined PP is used to generate RSA key pair; wherein the PRNG module comprises a PRNG to generate the required bit length of pseudorandom number, the PRNG takes an input seed value from a root key from a source and a given bit length, wherein a device hardware unique key is the seed value, and wherein the system is software implemented, and wherein the PNG module is further configured to: run filter function on PP to check if it has any small prime factor; the step of executing primality test on PP comprising: execute Rabin-Miller primality test on PP in response to PP has no small prime factor, wherein the PRNG module is configured to: receive a request from the PNG module , the request containing a bit length of the pseudorandom number required; generate the required bit length of pseudorandom number; and transmit a response containing the generated bit length of pseudorandom numbers to the PNG module . a pseudorandom number generator (PRNG) module and a prime number generator (PNG) module , wherein the PNG module is configured to: obtain a pseudorandom number from the PRNG module ; determine a big odd number denoted as PP according to the pseudorandom number, wherein a bit-size of PP is 1024 bit; execute primality test on PP; and determine PP as the output prime number in response to PP passing the primality test; obtain a pseudorandom number from the PRNG module ; determine a big odd number denoted as PP according to the pseudorandom number, wherein a bit-size of PP is 1024 bit; execute primality test on PP; and determine PP as the output prime number in response to PP passing the primality test; run filter function on PP to check if it has any small prime factor; the step of executing primality test on PP comprising: execute Rabin-Miller primality test on PP in response to PP has no small prime factor, wherein the PRNG module is configured to: receive a request from the PNG module , the request containing a bit length of the pseudorandom number required; generate the required bit length of pseudorandom number; and transmit a response containing the generated bit length of pseudorandom numbers to the PNG module . execute Rabin-Miller primality test on PP in response to PP has no small prime factor, wherein the PRNG module is configured to: receive a request from the PNG module , the request containing a bit length of the pseudorandom number required; generate the required bit length of pseudorandom number; and transmit a response containing the generated bit length of pseudorandom numbers to the PNG module . receive a request from the PNG module , the request containing a bit length of the pseudorandom number required; generate the required bit length of pseudorandom number; and transmit a response containing the generated bit length of pseudorandom numbers to the PNG module . <EOS>