0% found this document useful (0 votes)
18 views

Mod4 Publickey Encryption

This document discusses public key encryption and several public key encryption algorithms including RSA. It explains that public key encryption solves the key distribution problem by using a public/private key pair. The RSA algorithm is then described in detail, including how it generates the public and private keys, how encryption and decryption work using modular exponentiation, and issues around key generation and efficient exponentiation calculations. Examples are provided of how RSA encryption and decryption are performed.

Uploaded by

Amin Siddiq
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Mod4 Publickey Encryption

This document discusses public key encryption and several public key encryption algorithms including RSA. It explains that public key encryption solves the key distribution problem by using a public/private key pair. The RSA algorithm is then described in detail, including how it generates the public and private keys, how encryption and decryption work using modular exponentiation, and issues around key generation and efficient exponentiation calculations. Examples are provided of how RSA encryption and decryption are performed.

Uploaded by

Amin Siddiq
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 21

Public Key Encryption

Why public key cryptology?

 Solving key distribution


 Two parties already share a key
 Use a key distribution center (KDC)
 Digital signature

2
Confidentiality

3
Authentication

4
Authentication cont…

 To be more efficient
 Each document must be kept in the plaintext for
practical purpose
 A copy must be stored in ciphertext for verification in
case of a dispute

OR

 Use authenticator: small block of bits that is a


function of the document
 Safe from alteration, BUT not safe from
eavesdropping

5
Confidentiality & Authentication

6
Requirement for public-key cryptology

 Proposed by Diffie & Hellman (1976)


 It is computationally easy for a party B to generate a
pair of public key KUb and private key KRb
 It is computationally easy for a sender A, knowing
the public key and the message M, to generate
ciphertext
C = EKUb (M)
 It is computationally easy for a receiver B to decrypt
the ciphertext using the private key
M = DKRb (C) = DKRb (EKUb (M))
 It is computationally infeasible for opponent, knowing
public key KUb and ciphertext C to recover M
 It is computationally infeasible for opponent, knowing
public key Kub to determine the private key KRb
7
Knapsack Algorithm

 Based on the knapsack problem


 What is the knapsack problem?
 Determining which objects are in the knapsack
 Proposed by Ralph Merkle (1978)
 Message: n bits
 Cargo vector a = (a1, a2, …, an), ai integer
 Plaintext message block x = (x1, x2, …, xn), xi binary
 Ciphertext S = a. x =  (ai . xi)

 Encryption is easy
 Decryption: recover x using S and a
 It is difficult

8
Example

a = (1, 3, 2, 5)
S=3
What is x?

x = 1010 or x = 0100

 Requirement 1: Unique inverse for each value


of S
 Requirement 2: Decryption is hard in general,
BUT easy if specified knowledge is
available
9
Merke’s method

 Combine easy superincreasing knapsack with


difficult knapsack
 How?
 Choose a random easy knapsack vector a’ with n
elements
 Select 2 integers w and m such that

m >  ai ’

gcd (w, m) = 1
 Construct a hard knapsack vector a, where
a = w . a’ mod m

10
Knapsack algorithm
 Choose a superincreasing vector a’ (private)
 Choose an integer m larger than  ai’ (private)
 Choose an integer w relatively prime to m (private)
 Calculate w-1 the inverse of w (modulo m) (private)
 Calculate a = w. a’ (mod m) (public)

 Private key = {w-1, m, a’}


 Public key = {a}

11
Knapsack algorithm cont…

 Encryption

S=a.x

 Decryption

Define S’ = w-1 S (mod m)

S’ = w-1 (w a’) x (mod m)


= a’. x

12
RSA (Rivest-Shamir-Adleman) Algorithm

 Block cipher, plaintext and ciphertext are integers


between 0 and (n-1)
 Plaintext is encrypted in block, each block having a
binary value less than some number n
 Based on number theory and modular arithmetic
 Depends on difficulty of determining prime factors of
large numbers
 Two keys are used (d,e)
 Any of the key can be public
 Remaining one should be private

13
14
Algorithm Description

C = Me mod n

M = Cd mod n = Med mod n

 Both sender and receiver must know the value


of n
 The sender know the value of e
 Only the receiver know the value of d
 Public key: {e, n}
 Private key: {d, n}

15
C = Me mod n

M = Cd mod n = Med mod n


 Knowing d, determining M is simple
 Else, factoring Me is difficult

16
Requirements to be public-key encryption

 Is it possible to find values e, d, n such that

Med = M mod n for all M < n

 Is it easy to calculate Me and Cd for all M < n?


 Is it infeasible to determine d given e and n?

17
Detail Algorithm

 Choose two prime numbers p and q(private)


 Calculate n = pq (public)
 Calculate d, with gcd(Φ(n), d) = 1, 1 < d < Φ(n)
(private)
 Chosen e = d-1 mod Φ(n) (public)

 Public key: {e, n}


 Private key: {d, n}

18
Two Issues

 Encryption and Decryption


 The efficiency of exponentiation computation
 Key generation
 Determining two prime numbers p and q
 Selecting either e or d and calculating the other

19
Efficient Exponentiation

 Procedure exponentiation (a, m, n)


d := 1
for i = (k-1) down to 0 do
d = d2 mod n
if bi = 1 then d = d . a mod n
Return d

20
Demo RSA

www-cs-students.stanford.edu/~tjw/jsbn/rsa2.html

islab.oregonstate.edu/koc/ece575/02Project/Mor/

21

You might also like