Professional Documents
Culture Documents
3
Symmetric Encryption Problems
Key distribution
• How to have secure communications without trusting a key distribution
center (KDC) with your key
Digital signatures
• How to verify that a message comes intact from the claimed sender
Public-Key Encryption Characteristics
5
Public-Key Cryptosystems
• A public-key encryption scheme has six ingredients:
Encryption Decryption
Plaintext Public key Private key Ciphertext
algorithm algorithm
Accepts the
The
ciphertext
readable Performs The
Used for Used for and the
message or various scrambled
encryption encryption matching
data that is transform- message
or or key and
fed into the ations on produced as
decryption decryption produces
algorithm as the plaintext output
the original
input
plaintext
Bobs's
public key
ring
Joy
Ted
Mike Alice
Transmitted X=
Y = E[PUa, X]
Plaintext Plaintext
Cryptography
Encryption algorithm Decryption algorithm
input output
(e.g., RSA)
Alice's
public key
ring
Joy
Ted
Mike Bob
X=
X Transmitted D[PUb, Y]
ciphertext
Y = E[PRb, X]
Plaintext Plaintext
Encryption algorithm Decryption algorithm
input output
(e.g., RSA)
8
Advantages
9
Applications: Confidentiality
Y = E(PUb, X)
X = D(PRb, Y)
10
Applications: Authentication
Y = E(PRa, X)
X = D(PUa, Y)
11
Applications: Confidentiality + Authentication
• Developed in 1977 at MIT by Ron Rivest, Adi Shamir & Len Adleman
• Most widely used general-purpose approach to public-key encryption
• Is a cipher in which the plaintext and ciphertext are integers between
0 and n – 1 for some n
• A typical size for n is 1024 bits, or 309 decimal digits
RSA Algorithm
16
Assumptions
17
Algorithm Requirements
n = pq public calculated
19
Key Generation by Alice
Calculate n = p ´ q
Plaintext: M<n
Ciphertext: C = Me mod n
Ciphertext: C
Plaintext: M = Cd mod n
21
Example 2
• Select p = 17, q = 11
• Calculate n = pq = 17 × 11 = 187
• Calculate φ(n) = (p – 1) (q – 1) = 160
• Select e < 160, relatively prime to 160: e = 7
• Calculate d < 160, d*e mod 160 = 1
• repeat d = (k *160 + 1) / e
• increment k until you get an integer value
• 1 × 160 + 1 = 161; d = 161/7 = 23
22
Example 2
23
Exponentiation in Modular Arithmetic
• If exponentiation is done first, intermediate results
will be huge
• we can use property of modular arithmetic
[(a mod n) × (b mod n)] mod n = (a × b) mod n
• To calculate x11 mod n
• x11 = x1+2+8 = (x)(x2)(x8)
• compute x mod n, x2 mod n, x4 mod n, x8 mod n
• calculate [(x mod n) × (x2 mod n) × (x8 mod n)] mod n
24
Example 2
• 887 mod 187 = [(884 mod 187) × (882 mod 187) × (881 mod 187)] mod
187
• 881 mod 187 = 88
• 882 mod 187 = 7744 mod 187 = 77
• 884 mod 187 = 59,969,536 mod 187 = 132
• 887 mod 187 = (88 × 77 × 132) mod 187
= 894,432 mod 187 = 11
25
Example 2
26
CEN 585
Computer and Network Security
Chapter 10
Other Public-Key Cryptosystems
Dr. Abdulrahman Almutairi
Computer Engineering Department
College of Computer and Information Sciences
King Saud University
Diffie-Hellman Key Exchange
30
Example
31
Example
33