A batch GCD algorithm finds shared factors across many RSA moduli without computing every pairwise GCD. Let N be the product of all moduli. For each modulus n, compute gcd(n, N/n): a nontrivial result reveals a prime factor shared with another public key. section 8.4.1
A direct batch procedure is:
- Multiply every public modulus into one product. section 8.4.1
- For each modulus, derive the product of all other moduli and take its GCD with that modulus. section 8.4.1
- Ignore GCD results of 1 or the modulus itself; otherwise treat the result as p, derive q = n/p, then reconstruct the RSA private exponent. section 8.4.1
Shared-prime moduli
For 225691 = 269 × 839 and 40619 = 151 × 269, each modulus has GCD 269 with the product of the other moduli. That factor permits recovery of the corresponding private keys. section 8.4.1
Figure 8.17 Using a remainder tree to efficiently calculate batch GCD
A remainder tree illustrates the more efficient batch-GCD approach for large collections. section 8.4.1
