Example
p=47, q = 71 => n= pq = 3337
encryption key e must have no factors in common with (p-1)(q-1)=46 * 70 = 3220.
Choose e at random to be 79.
=> d= 79 -1 mod 3220 = 1019. [ (1019 x 79) mod 3220 = 1]
Publish e, n; keep d secret.
To encrypt M = 688, then E(M) = 688 79 mod 3337 = 1570
To decrypt C= 1570, then D(C) = 1570 1019 mod 3337 = 688