Week 10 Public Key Cryptography - Part 1 2
Week 10 Public Key Cryptography - Part 1 2
Adopted from
Chaminda Hewage (ph.d.),
Cardiff Metropolitan University
Learning outcomes
• Students should be able to demonstrate an understanding about
• Asymmetric encryption/Public-Key encryption
• RSA algorithm
PROBLEMS WITH SYMMETRIC CRYPTOGRAPHY
• Symmetric trust
• Key establishment
Properties of public-key cryptosystems
Intruder
Marwan Omar
Comm
Hello Medium
bye
Key
Encrypt #1weqAD@ Decrypt
#1weqAD@12458#@#1
Drawbacks of The briefcase protocol
• Authentication
• Efficiency
A BLUEPRINT FOR A PUBLIC-KEY CRYPTOSYSTEM
• Let p = 3 and q = 7.
• Modulus n =?
• Lets find e?
• 1 < e < (p − 1)(q − 1)
• In this case (p − 1)(q − 1) = 2 × 6 = 12. Therefore 1 < e < 12
• Any suitable choice of e must have the property that there are no numbers
that neatly divide into e and 12, except for 1.
GENERATING AN RSA KEY PAIR
• Forming the public key. The pair of numbers (n, e) form the RSA public
key and can be made available to anyone who wishes to send encrypted
messages to the holder of the private key
• Generating the private key. We compute the private key d from p, q and
e.
e X d = 1 mod (p − 1)(q − 1).
GENERATING AN RSA KEY PAIR
• Generating the modulus. Let p = 47 and q = 59. Thus: n = pq = 47 × 59 = 2773.
• Generating e. Select e = 17, which is a valid choice since there is no number
that divides into 17 and (p − 1)(q − 1) = 46 × 58 = 2668, except for 1.
• Forming the public key. The pair of numbers (n, e) = (2773, 17) form the
public key and can be made available to anyone whom we wish to be able to
send us encrypted messages.
• Generating the private key. Input p = 47, q = 59 and e = 17 to the Extended
Euclidean Algorithm. The output will be d = 157. We can check that this result
is correct by computing:
d X e = 1 mod (p-1)(q-1) = 1 mod 2668 = 2669 = d X 17
• The private key is d = 157, which is a value that only we know.
Encryption and decryption using RSA
• RSA ENCRYPTION: Suppose that we wish to send some plaintext to
someone whose public key is (n, e).
• C = Pe mod n
• example, if the plaintext is P = 31 then encrypting using public key
(2773, 17) results in: C = 3117 = 587 mod 2773 = 587
Encryption and decryption using RSA
• RSA DECRYPTION: All the receiver does is to raise cypher text C to the
power of their private key d. The result will be the plaintext P. In other
words:
• P = Cd mod n
• Returning again to our numerical example, the cipher text C = 587 can
be decrypted using private key 157 to obtain:
• P = 587157 mod n = 31 mod 2773.
Security of RSA
An attacker can either attempt to:
• decrypt a cipher text without knowledge of the private key;
• determine the private key directly from the public key.
Other public Key algorithms
• ElGamal cryptosystem
• Elliptic curve cryptography
RELATIVE KEY LENGTHS
Hybrid encryption
Summary
• Asymmetric encryption
Questions.
Your Guide to Knowledge