- Bob generates two large primes, p and q

Probabilistic primality testing*O*((*lg n*)^{3}) - Bob computes n = pq and (n) = (p-1)(q-1)
- Bob chooses random e (1 < e < )
such that
gcd(e, (n)) = 1

Euclidean algorithm - Bob computes d =
*e*^{-1}mod (n)

Extended Euclidean Algorithm*O*((*lg n*)^{2}) - Bob publishes n and e in a directory as his public key