Public Key Cryptography and RSA
Public Key Cryptography and RSA
RSA
Nelson Ochieng
Overview
• Based on exponentiation
• Developed in 1977 by Ron Rivest, Adi Shamir,
and Len Adleman at MIT
• Most widely accepted and implemented general-
purpose approach to public-key encryption.
• A block cipher in which the PT and CT are
integers between 0 and n-1 for some n.
Description of the Algorithm
• C=Me mod n
• M=Cd mod n
• Both the sender and the receiver must known n.
the sender knows the value of e, and only the
receiver knows the value of d.
• PU={e,n}
• PR={d,n}
• Steps:
– Select 2 prime numbers, p=17 and q=11
– Calculate n=pq =17*11=187
– Calculate phi(n) = (p-1)*(q-1) = 16*10=160
– Select e such that e is relatively prime to phi(n) and less
than phi(n), for example e=7.
– Determine d such that de ≡1 mod 160 and d < 160. The
correct value of d=23, because 23*7=161
– The resulting keys are public key PU={7,187} and
private key PR={23,187}
RSA Example En/Decrypt