# RSA and Prime numbers distribution law [duplicate]

I have read a few articles and watched some Youtube videos explaining the algorithm of RSA. It seems that RSA is mainly based on a mathematical trick (Prime Factorization). I am wondering though what's the relation between both Prime Factorization and Prime numbers distribution law? and also what would be the sort of RSA if someone could figure a mathematical solution for Prime numbers distribution (e.g: unsolved Riemann hypothesis)?

## marked as duplicate by tylo, e-sushiAug 19 '16 at 20:34

• Imagine the number of atoms in the universe. Then put this many prime numbers into each atom in the universe. Then the whole universe would contain (very roughly) as many primes at there are primes with $512$ bit. Any thought of iterating over prime numbers (even if you know exactly where to look) is not realistic. – tylo Aug 19 '16 at 18:12
The Riemann hypothesis would give a much better error term in the Prime Number Theorem, i.e., the distribution of the primes. This improvement, however, won't have much bearing on factoring efficiency. At the large sizes used for RSA, there are way too many prime number pairs that could have been used to obtain the RSA modulus $N.$