Implementing RSA
Bob generates two large primes, p & q
- Probabilistic primality testing O((log n) 3)
Bob computes n = pq and f(n) =(p-1)(q-1)
Bob chooses random e (1 < e < f(n)) such that gcd(e, f(n) ) = 1
Bob computes d = e -1 mod f(n)
- Extended Euclidean Algorithm O((log n)2)
Bob publishes n and e in a directory as his public key.