Asymmetric Key Cryptography
Asymmetric Key Cryptography
Cryptography
Objectives
To distinguish between two cryptosystems:
symmetric-key and asymmetric-key
To introduce trapdoor one-way functions and their
use in asymmetric-key cryptosystems
To introduce the knapsack cryptosystem as one of
the first ideas in asymmetric-key cryptography
To discuss the RSA cryptosystem
To discuss the ElGamal cryptosystem
INTRODUCTION
Plaintext/Ciphertext
Unlike in symmetric-key cryptography, plaintext
and cipher text are treated as integers in
asymmetric-key cryptography.
Encryption/Decryption
C = f (Kpublic , P) P = g(Kprivate , C)
Need for Both
Functions
1. f is easy to compute.
2. f −1 is difficult to compute.
Example
When n is large, n = p × q is a one-way function. Given p and
q , it is always easy to calculate n ; given n, it is very difficult to
compute p and q. This is the factorization problem.
Example
When n is large, the function y = xk mod n is a trapdoor one-
way function. Given x, k, and n, it is easy to calculate y. Given
y, k, and n, it is very difficult to calculate x. This is the discrete
logarithm problem. However, if we know the trapdoor, k′ such
that k × k ′ = 1 mod f(n), we can use x = yk′ mod n to find x.
Knapsack Cryptosystem
Definition
a = [a1, a2, …, ak ] and x = [x1, x2, …, xk].
Superincreasing Tuple
ai ≥ a1 + a2 + … + ai−1
Continued
e.g. : Assume that a = [17, 25, 46, 94, 201,400] and s = 272 are
given.
Continued
Example
As a very trivial example, assume that a = [17, 25, 46, 94,
201,400] and s = 272 are given. Table 10.1 shows how the
tuple x is found using inv_knapsackSum routine in Algorithm
10.1. In this case x = [0, 1, 1, 0, 1, 0], which means that 25, 46,
and 201 are in the knapsack.
Secret Communication with Knapsacks.
Continued
Encryption
Continued
Decryption
Key Generation
Continued
Continued
Note
The bit-operation complexity of encryption or
decryption in ElGamal cryptosystem is polynomial.
Continued
Example
Example
Instead of using P = [C2 × (C1d) −1] mod p for decryption, we can
avoid the calculation of multiplicative inverse and use
P = [C2 × C1 p−1−d] mod p (Fermat’s little theorem). In previous
example, we can calculate P = [6 × 5 11−1−3] mod 11
= 7 mod 11.
Analysis of ElGamal
ElGamal cryptosystem is a puzzle. It can be solved as
follows:
1.
2.
3.
Security of ElGamal
Two attacks have been mentioned for this
cryptosystem:
1. Low-Modulus Attack:
If p is not large enough, attacker can use efficient algorithms to
solve discrete logarithm problem to find d or r.
Recommended that p be at least 1024 bits (300 decimal digits)
2. Known-Plaintext Attack:
It is recommended that sender use a fresh value of r to prevent
this type of attack.