PrimeNumber Generator


Provides a large prime number however long as you want, randomly and verified by Miller-Rabin process. This number is not independently verified as a prime, which would require factoring it against the square root of it, and any prime number up to it. However the probability after passing the Miller-Rabin test of it being a true prime is very very high, and reasonable for non-military critical encryption.




Just put in a bit length for your desired length.

This is not run asynchronously so if you put in a value of 400 or something it could take some time to perform the Miller-Rabin confirmation. We return as a string, as numbers > 64 bits can cause problems when passed as a long or integer.

29 has 5 bits
1048576 has 20 bits
1099511627776 has 40 bits
1152921504606846976 has 60 bits
18446744073709551616 has 64 bits

Download PrimeNumber.aix (7.5 KB)