Type the RSA key-generation steps (as a Q→A you can reproduce cold)
Type the RSA key-generation steps (as a Q→A you can reproduce cold)
Answer
n = p * q phi = (p - 1) * (q - 1) choose e with gcd(e, phi) == 1 d = mod_inverse(e, phi) public = (e, n); secret = (d, n)
φ(pq) = (p−1)(q−1); e must be coprime to φ(n); d is e⁻¹ mod φ(n) via EXTENDED-EUCLID. Then encrypt with C = M^e mod n, decrypt with M = C^d mod n.