Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key...

34
Symmetric-Key Cryptography

Transcript of Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key...

Page 1: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Symmetric-Key

Cryptography

Page 2: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

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

To discuss the ElGamal cryptosystem

To discuss the elliptic curve cryptosystem

Page 3: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

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.

1 Keys

2 General Idea

3 Need for Both

4 Trapdoor One-Way Function

5 Knapsack Cryptosystem

Page 4: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

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.

Symmetric-key cryptography is based on sharing secrecy;

asymmetric-key cryptography is based on personal secrecy.

Note

Page 5: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Asymmetric key cryptography uses two separate keys: one

private and one public.

Keys

Locking and unlocking in asymmetric-key cryptosystem

Page 6: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

General Idea

General idea of asymmetric-key cryptosystem

Page 7: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Plaintext/Ciphertext

Unlike in symmetric-key cryptography, plaintext and

ciphertext are treated as integers in asymmetric-key

cryptography.

C = f (Kpublic , P) P = g(Kprivate , C)

Encryption/Decryption

Page 8: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

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.

Need for Both

Page 9: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

The main idea behind asymmetric-key cryptography is the

concept of the trapdoor one-way function.

Trapdoor One-Way Function

Functions

A function as rule mapping a domain to a range

Page 10: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Trapdoor One-Way Function (TOWF)

One-Way Function (OWF)

1. f is easy to compute.

2. f −1 is difficult to compute.

3. Given y and a trapdoor, x can be

computed easily.

Page 11: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Example

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.

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.

Page 12: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

RSA CRYPTOSYSTEM

The most common public-key algorithm is the RSA

cryptosystem, named for its inventors (Rivest, Shamir,

and Adleman).

1 Introduction

2 Procedure

3 Some Trivial Examples

4 Attacks on RSA

5 Recommendations

6 Optimal Asymmetric Encryption Padding (OAEP)

7 Applications

Page 13: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Complexity of operations in RSA

Page 14: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Procedure

Encryption, decryption, and key generation in RSA

Page 15: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Two Algebraic Structures

Encryption/Decryption Ring: R = <Zn , +, × >

Key-Generation Group: G = <Z f(n)∗, × >

Page 16: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept
Page 17: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Encryption

Page 18: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Decryption

Page 19: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Proof of RSA

Page 20: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Some Trivial Examples Example

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:

Page 21: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Some Trivial Examples Example

Bob receives the ciphertext 28 and uses his private key 37 to

decipher the ciphertext:

Now assume that another person, John, wants to

send a message to Bob. John can use the same

public key announced by Bob (probably on his

website), 13; John’s plaintext is 63. John calculates

the following:

Page 22: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Example

Suppose Ted wants to send the message “NO” to

Jennifer. He changes each character to a number

(from 00 to 25), with each character coded as two

digits. He then concatenates the two coded

characters and gets a four-digit number. The plaintext

is 1314. Figure 10.7 shows the process.

Jennifer creates a pair of keys for herself. She

chooses p = 397 and q = 401. She calculates

n = 159197. She then calculates f(n) = 158400. She

then chooses e = 343 and d = 12007. Show how Ted

can send a message to Jennifer if he knows e and n.

Page 23: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Encryption and decryption

Page 24: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Attacks on RSA

Taxonomy of potential attacks on RSA

Page 25: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Attacks on RSA

Factorization

The security of RSA is based on the fact

that modulus is so large that it is

infeasible to factor it in reasonable time.

To be secure, RSA requires that n will be

300 decimal digits, then modulus must be

at least 1024 digits.

No factorization algorithm till date can

factorize such a large number in

reasonable amount of time.

Page 26: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept
Page 27: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Attacks on RSA Chosen-Ciphertext Attack

1. Eve intercepts c a ciphertext message from

Alice.

2. Eve chooses a random number r, r<n;

3. Eve finds Alice’s public key e.

4. Eve: x= r^e mod n

5. Eve: y = x c mod n

6. Eve: t = r^-1 mod n

7. If x = r^e mod n, then r = x^d mod n

8. Eve requests Alice to sign y with her private

key d.

9. Alices sends Eve, u = y^d mod n

10.Eve: t u mod n = r^-1 y^d mod n = r^-1 x^d

c^d mod n = c^d mod n = m.

Page 28: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Attacks on Encryption Component of RSA

To reduce encryption time, a low value of e

is used sometimes.

Coppersmith Theorem Attack:

In a mod n polynomial f(x) of degree e, one

can use an algorithm of complexity log n to

find the roots if one of the roots is smaller

than n^(1/e).

Page 29: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Attacks on Encryption Component of RSA

To reduce encryption time, a low value of e

is used sometimes.

Broadcast attack:

If an entity sends the same message to a

group of recipients with the same low

encryption exponent.

C1 = P^3 mod n1,

C2 = P^3 mod n2

C3 = P^3 mod n3

By CRT, C’ = P^3 mod n1 n2 n3.

Hence P^3 < n1 n2 n3, - C’ = P^3.

Page 30: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Attacks on Decryption Exponent of RSA

Revealed decryption component attack:

If Eve knows the value of d, she can use a

probabilistic algorithm to factor n and find

the value of p and q.

If Bob changes only the compromised

decryption exponent, but keeps the same

modulus n, then Eve will be able to decrypt

future messages because she has the

factorization n.

Page 31: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Timing attack

Attack is based on the fast-exponential

algorithm.

The algorithm uses only squaring if the

corresponding bit in the decryption

exponent is d is 0, else it uses both squaring

and multiplication.

Timing required for each iteration is longer if

the corresponding bit in d is 1.

The timing difference allows Eve to compute

the bits in d one by one.

Page 32: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Timing attack

Solutions:

1. Add random delays during

exponentiation.

2. Blinding:

1. Select a secret random number r

between 1 and n-1.

2. Calculate C1=C r ^e mod n

3. Calculate P1 = C1 ^d mod n

4. Calculate P = P1 r ^-1 mod n.

Page 33: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Power attack

Similar to timing attack.

Kocher showed that

If Eve can measure the power consumed

during decryption, then similar idea will be

used.

An iteration involving squaring and

multiplication requires more power.

Page 34: Symmetric-Key Cryptography · cryptography does not eliminate the need for symmetric-key cryptography. Need for Both . The main idea behind asymmetric-key cryptography is the concept

Timing attack

Attack is based on the fast-exponential

algorithm.

The algorithm uses only squaring if the

corresponding bit in the decryption

exponent is d is 0, else it uses both squaring

and multiplication.

Timing required for each iteration is longer if

the corresponding bit in d is 1.

The timing difference allows Eve to compute

the bits in d one by one.