Integer factorization decomposes an integer into prime factors. Public-key cryptography uses the asymmetry that multiplying large primes is easy, while recovering those primes from their product is computationally expensive on classical computers. section 8.3 section 8.3.2
From a small product to RSA-sized integers
Factoring 764,512 can begin with trial division. If n = p × q uses two 512-bit primes, finding p and q requires trying many possibilities; this one-way behavior supplies RSA's trapdoor function. Classical methods such as Fermat's differences of squares and Pollard's methods improve on naive trial division but remain infeasible for examples involving 2,048-bit primes. section 8.3.2 section 8.3.2
RSA makes the factorization relationship operational: the public key contains n and e, while the private key contains d. Encryption computes c = m^e mod n, and decryption computes m = c^d mod n. Recovering the private relationship from public information is tied to factoring n. section 8.3.2 section 8.3.2
Security consequences follow from both the mathematical problem and its implementation:
- Use sufficiently large, independently generated primes; weak randomness or hardware faults caused 0.3%–0.5% of internet RSA keys to share primes, enabling rapid discovery with batch GCD. section 8.5
- Avoid textbook RSA because deterministic encryption gives identical plaintexts identical ciphertexts; probabilistic padding adds randomness. section 8.5
- Avoid small private exponents; fixed small public exponents commonly help guarantee sufficiently large private exponents. section 8.5
- Account for quantum risk: Shor's algorithm efficiently solves integer factorization in theory, although current demonstrations and scaling remain far below cryptographic key sizes. section 8.3 section 8.3.2
Figure 8.13 The penultimate page of Pietro Antonio Cataldo’s 1603 book Trattato de’ numeri perfetti, showing prime factors for numbers from 625 to 743 (a prime number)
A historical prime-factor table makes the basic decomposition task concrete before extending it to cryptographic-size integers. section 8.3.2


