The extended Euclidean algorithm (EEA) efficiently computes the greatest common divisor of two integers while expressing that divisor as a linear combination of them. In RSA key generation, it finds the private exponent d, the modular inverse of the public exponent e modulo φ(n). section 8.3.2
Use the EEA in RSA key generation to:
- Choose e so that gcd(e, φ(n)) = 1. section 8.3.2
- Compute d = e⁻¹ mod φ(n) with the EEA. section 8.3.2
- Verify the result by checking ed ≡ 1 mod φ(n). section 8.3.2
RSA key-generation calculation
For p = 193 and q = 727, φ(n) = 139392. Choosing e = 17653, the EEA produces d = 77533. Verification gives 17653 × 77533 ≡ 1 mod 139392. section 8.3.2

