Module-3-2
Module-3-2
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 Rabin cryptosystem
INTRODUCTION
Note
Symmetric-key cryptography is based on sharing secrecy;
asymmetric-key cryptography is based on personal secrecy.
Keys
Plaintext/Ciphertext
Unlike in symmetric-key cryptography, plaintext and
ciphertext 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 (n), we can use x = yk′ mod n to find x.
Knapsack Cryptosystem
Definition
Suppose we are given two k-tuples, a = [a1, a2, …, ak] and
x = [x1, x2, …, xk]. The first tuple is the predefined set;
the second tuple, in which xi is only 0 or 1, defines which elements
of a are to be dropped in the knapsack.
The sum of elements in the knapsack is
Superincreasing Tuple
ai ≥ a1 + a2 + … + ai−1
Continued
Example
Let us see how Alice can send a secret message to Bob using a
knapsack cryptosystem. The idea is shown in Figure
Example
Encryption
10.2.2 Continued
Decryption
10.2.2 Continued
Proof of RSA
10.2.3 Some Trivial Examples
Example 10. 5
Bob chooses 7 and 11 as p and q and calculates n = 77. The
value of (n) = (7 − 1)(11 − 1) or 60. Now he chooses two
exponents, e and d, from Z60∗. If he chooses e to be 13, then
d is 37. Note that e × d mod 60 = 1 (they are inverses of each
Now imagine that Alice wants to send the plaintext 5 to Bob.
She uses the public exponent 13 to encrypt 5.
Key Generation
10.3.1 Continued
Encryption
10.3.1 Continued
Decryption
Note
The Rabin cryptosystem is not deterministic:
Decryption creates four plaintexts.
10.3.1 Continued
Example 10. 9