The prime number theorem estimates how primes are distributed among large integers. Let π(N) count primes less than or equal to N. Its asymptotic relation, π(N) ~ N/ln(N), says that primes grow less frequent as N grows while remaining plentiful at cryptographic sizes. section 8.4.1
Equation 8.17
\[\begin{aligned} \begin{aligned} \pi(N) \sim \frac{N}{\ln(N)} \end{aligned} \label{equation:prime-number-theorem} \end{aligned}\]Use the theorem’s estimate for the number of primes up to a bound N. section 8.4.1
Estimating a 512-bit prime pool
Applying the estimate to 2^512 gives π(2^512) ~ 2^503/ln(2), placing the number of available 512-bit primes roughly between 2^503 and 2^504. This immense space means shared RSA primes are not expected from an ideal uniform RNG, even at enormous scale. section 8.4.1
This distinction matters for the common-factors attack: reused RSA primes indicate hardware faults or poor entropy rather than a shortage of large primes. A weak generator that chooses from a limited pool can cause moduli to share a factor, allowing a GCD calculation to recover it and enable private-key reconstruction. section 8.4.1
