0% found this document useful (0 votes)
15 views22 pages

Rsa 1

Uploaded by

srishtigaikwad19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views22 pages

Rsa 1

Uploaded by

srishtigaikwad19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Chapter 10

Objectives
q To distinguish between two cryptosystems:
symmetric-key and asymmetric-key
q To introduce trapdoor one-way functions and their
use in asymmetric-key cryptosystems
q To discuss the RSA cryptosystem
q To discuss the Rabin cryptosystem
q To discuss the ElGamal cryptosystem
q To discuss the elliptic curve cryptosystem

10.2
10-1 INTRODUCTION

Symmetric and asymmetric-key cryptography will exist


in parallel and continue to serve the community. We
actually believe that they are complements of each
other; the advantages of one can compensate for the
disadvantages of the other.

Topics discussed in this section:


10.1.1 Keys
10.1.2 General Idea
10.1.3 Need for Both
10.1.4 Trapdoor One-Way Function

10.3
10-1 INTRODUCTION

Symmetric and asymmetric-key cryptography will exist


in parallel and continue to serve the community. We
actually believe that they are complements of each
other; the advantages of one can compensate for the
disadvantages of the other.

Note
Symmetric-key cryptography is based on sharing secrecy;
asymmetric-key cryptography is based on personal secrecy.

10.4
10.1.1 Keys

Asymmetric key cryptography uses two separate keys: one


private and one public.

Figure 10.1 Locking and unlocking in asymmetric-key cryptosystem

10.5
10.1.2 General Idea

Figure 10.2 General idea of asymmetric-key cryptosystem

10.6
10.1.2 Continued

Plaintext/Ciphertext
Unlike in symmetric-key cryptography, plaintext and
ciphertext are treated as integers in asymmetric-key
cryptography.

Encryption/Decryption

C = e(Kpublic , P) P = d(Kprivate , C)

10.7
10.1.3 Need for Both

There is a very important fact that is sometimes


misunderstood: The advent of asymmetric-key
cryptography DOES NOT eliminate the need for
symmetric-key cryptography.

10.8
10.1.4 Trapdoor One-Way Function

The main idea behind asymmetric-key cryptography is the


concept of the trapdoor one-way function.

Functions

Figure 10.3 A function as rule mapping a domain to a range

10.9
10.1.4 Continued
One-Way Function (OWF)

1. f is easy to compute.
2. f −1 is difficult to compute.

Trapdoor One-Way Function (TOWF)

3. Given y and a trapdoor, x can be


computed easily.

10.10
10.1.4 Continued

Example 10. 1
When n is large, n = p × q is a one-way function.
Easy Given p and q à calculate n
Difficult Given n à calculate p and q
This is the factorization problem.
Example 10. 2
When n is large, the function y = xk mod n is a trapdoor
one-way function.
Easy Given x, k, and n à calculate y
Difficult Given y, k, and n à 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.

10.11
10-2 RSA CRYPTOSYSTEM

The most common public-key algorithm is the RSA


cryptosystem, named for its inventors (Rivest, Shamir,
and Adleman).

Topics discussed in this section:


10.2.1 Introduction
10.2.2 Procedure
10.2.3 Some Trivial Examples
10.2.4 Attacks on RSA

10.12
10.2.1 Introduction

Figure 10.5 Complexity of operations in RSA

10.13
10.2.2 Procedure

Figure 10.6 Encryption, decryption, and key generation in RSA

10.14
Public key encryption algorithms
Requirements:

1
+ . .
need KB ( ) and K - ( ) such that
B
- +
K (K (m)) = m
B B
+
2 given public key KB , it should be
impossible to compute private
-
key K B

RSA: Rivest, Shamir, Adleman algorithm


8: Network Security 8-15
RSA: Choosing keys
1. Choose two large prime numbers p, q.
(e.g., 1024 bits each)

2. Compute n = pq, z = (p-1)(q-1)

3. Choose e (with e<n) that has no common factors


with z. (e, z are “relatively prime”).

4. Choose d such that ed-1 is exactly divisible by z.


(in other words: ed mod z = 1 ).

5. Public key is (n,e). Private key is (n,d).


+ -
KB KB
8: Network Security 8-16
RSA: Encryption, decryption
0. Given (n,b) and (n,a) as computed above

1. To encrypt bit pattern, m, compute


e e
x = m mod n(i.e., remainder when m is divided by n)

2. To decrypt received bit pattern, c, compute


d
m = xd mod n(i.e., remainder when c is divided by n)

Magic d
m = (m e mod n) mod n
happens!
x

8: Network Security 8-17


RSA example:
Bob chooses p=5, q=7. Then n=35, z=24.
e=5 (so e, z relatively prime).
d=29 (so ed-1 exactly divisible by z.

letter m me c = me mod n
encrypt:
l 12 1524832 17

d
decrypt:
c c m = cd mod n letter
17 481968572106750915091411825223071697 12 l

8: Network Security 8-18


RSA: Why is that m = (m e mod n) d mod n

Useful number theory result: If p,q prime and


n = pq, then: y y mod (p-1)(q-1)
x mod n = x mod n

e
(m mod n) d mod n = medmod n
ed mod (p-1)(q-1)
= m mod n
(using number theory result above)
1
= m mod n
(since we chose ed to be divisible by
(p-1)(q-1) with remainder 1 )

= m
8: Network Security 8-19
RSA: another important property
The following property will be very useful later:

- + + -
K (K (m)) = m = K (K (m))
B B B B

use public key use private key


first, followed first, followed
by private key by public key

Result is the same!

8: Network Security 8-20


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 f(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.

Bob receives the ciphertext 26 and uses the private key 37


to decipher the ciphertext:

10.21
n http://www-fs.informatik.uni-
tuebingen.de/~reinhard/krypto/Engl
ish/4.1.e.html

10.22

You might also like