Lecture 3 RSA
Lecture 3 RSA
Lecture 3 RSA
The development of public-key cryptography is the greatest and perhaps the only true
revolution in the entire history of cryptography.
The first use of public key cryptography is for encrypting messages to Bob. Anyone who
wishes to send an encrypted message to Bob will use Bob’s public key. To decrypt the
message, Bob’s private key is needed, and only Bob knows it.
1
The second use of public key cryptography is for message signing by Bob. Bob’s private
key is used by Bob to generate a signature. Any one is able to verify Bob’s signature
using Bob’s public key. Denote the signature of the message M by (M).
Message, Message,
Yes/No Message
Verification (M) Authentication
The encryption (or verification) algorithm and the decryption (or authentication)
algorithms may or may not be the same.
2
History of Public Key Cryptography
1976 – Diffie & Hellman published an article ‘Public Key Cryptography’ that presented
the model. They got a patent but never used it to license the technology. They also
came up with a protocol for a Key Exchange protocol based on their method.
1977 – Rivest, Shamir, and Adleman invented the RSA scheme which provides
Encryption, Signature, and Key Exchange. RSA became the most popular method
for public key cryptography.
Since – Many other methods implemented the public key model. For example:
El Gamal – Encryption, Signature, and Key Exchange (developed by El Gamal).
DSS – Digital Signature Standard (developed by NIST).
DH – Key exchange (developed by Diffie and Hellman).
The table below summarizes some of the important aspects of symmetric (Private-Key
Cryptography) and public-key encryption. To discriminate between the two, we refer
to the key used in symmetric encryption as a secret key (Private-Key Cryptography)
and asymmetric (Public-Key Cryptography)
Private-Key Cryptography Public-Key Cryptography
• The same algorithm with the • One algorithm is used for
same key is used for encryption encryption and decryption with a
and decryption pair of keys, one for encryption
and one for decryption.
• Key is shared by both sender • sender and receiver used different
and receiver keys
• Also known as symmetric, both • Asymmetric since parties are not
parties are equal equal
• Provide secrecy • Provide secrecy, authentication
and session keys.
• For example DES cipher • For example RSA cipher algorithm.
algorithm.
3
RSA Algorithm
The algorithm was developed 1977 by Ron Rivest, Adi Shamir, and Len Adleman at
MIT and first published in 1978. The RSA scheme has since that time reigned supreme
as the most widely accepted and implemented general-purpose approach to public-key
encryption.
It is a block cipher in which the plaintext and ciphertext are integers between 0 and n 1
for some n.
4 Part #3 Decryption:
- Ciphertext: C
- Plaintext M =C d mod n
Example:
4
Suppose p=17, q=11. Using RSA to encrypt the message M=88
Solution:
- n=p*q 17*11 =187
- φ (n) = (p-1)(q-1) = 16*10
=160
- choose e verifies gcd ¿
then e=7
- choose d verifies e .d ≡1 mod φ ( n ), then d=23
7.23 ≡1 mod 160
- PU={7, 187}
- PR={23,17,11}
The decryption:
d
M =C mod n
23
M =11 mod 187=88
5
Example: what is the Result of the Fast Modular Exponentiation Algorithm for ab mod n,
where a = 7, b = 560, n = 561.
Solution:
Note that the variable c is not needed; it is included for explanatory purposes. The final
value of c is the value of the exponent. Note: The integer b is expressed as a binary
number bk bk-1 ... b0. The value of b should convert to binary scheme, so b=
1000110000. Table below shows the result of algorithm application
560
∴7 mod 561=1
6
Assignment:
1. If p=61, q= 53, e=17 and the encrypted message C= 855. What is the original
message m?
2. The ciphertext C =10 sent to a user whose public key is e=5, n=35. What is the
plaintext M?