CIS 5371 Cryptography

26
1 CIS 5371 Cryptograph 3b. Pseudorandomness. Based on: Jonathan Katz and Yehuda Lindell Introduction to Modern Cryptography

description

CIS 5371 Cryptography. 3b. Pseudorandomness . B ased on: Jonathan Katz and Yehuda Lindell Introduction to Modern Cryptography. Pseudorandomness An introduction. - PowerPoint PPT Presentation

Transcript of CIS 5371 Cryptography

Page 1: CIS 5371   Cryptography

1

CIS 5371 Cryptography

3b. Pseudorandomness.Based on: Jonathan Katz and Yehuda Lindell Introduction to Modern Cryptography

Page 2: CIS 5371   Cryptography

2

Pseudorandomness An introduction

• A distribution D is pseudorandom if no PPT distinguisher can detect if it a string sampled according to D or chosen uniformly at random.

• This is formalized by requiring that every PPT algorithm outputs 1 with almost the same probability when given a truly random string as when given a pseudorandom string.

Page 3: CIS 5371   Cryptography

3

Pseudorandomness An introduction

• A pseudorandom generator is a deterministic algorithm that given a short truly random seed of length n will stretch it to into a longer string of length that is pseudorandom.

Page 4: CIS 5371   Cryptography

4

Existence of pseudorandom generators

• We cannot prove that pseudorandom

generators exist!• We believe that such generators can be

constructed from one-way functions.• There are some long-standing problems

that have no efficient solution and it is believed that they are unsolvable in polynomial time.

Page 5: CIS 5371   Cryptography

5

Pseudorandom generators informal

definition• A distribution D is pseudorandom if no PPT

distinguisher can detect if it is given a string sampled according to D or a string chosen uniformly at random.

• This can be formalized by requiring that a PPT distinguisher D outputs 1 with almost the same probability when given a truly random string and when given a pseudorandom string.

Page 6: CIS 5371   Cryptography

6

Pseudorandomness Definition

Let be a polynomial and a deterministic polynomial-time algorithm that on input any will output string of length . is a pseudorandom generator if:

• ∀ PPT distinguishers D, where is uniform random string of length is uniform random of length and the probabilities are taken over the coins used by and the choices of .

Page 7: CIS 5371   Cryptography

7

A secure fixed length encryption scheme𝑘

𝑝𝑙𝑎𝑖𝑛𝑡𝑒𝑥𝑡 h𝑐𝑖𝑝 𝑒𝑟𝑡𝑒𝑥𝑡𝑋𝑂𝑅

𝑝𝑎𝑑

Page 8: CIS 5371   Cryptography

8

A secure fixed length encryption Protocol

Let be a pseudorandom generator with expansion factor . Define a private-key encryption scheme for messages of length as follows• Gen: on input choose uniformly at random and output as key.• Enc: on input a key and a message m output the ciphertext

• Dec: on input a key and a ciphertext c output the plaintext

Page 9: CIS 5371   Cryptography

9

A secure fixed length encryption Theorem

If be a pseudorandom generator then protocol is a fixed-length private-key encryption scheme that has indistinguishable encryptions in the presence of an eavesdropper.

Page 10: CIS 5371   Cryptography

10

A secure fixed length encryption Reduction

Adversary A (Protocol ) 𝑤

𝑏 ′

𝑐𝑏

𝑚0 ,𝑚1

1𝑛

1 if 0 if

choose a random bit compute

Suppose that A succeeds with probability

Adversary A’ (Distinguisher D)

Page 11: CIS 5371   Cryptography

11

A secure fixed length encryption Proof

Let Pr . Then, • when is uniform random we have .• when we have

Pr .

Page 12: CIS 5371   Cryptography

12

A secure fixed length encryption Proof

Therefore when is chosen uniformly in

Page 13: CIS 5371   Cryptography

13

Variable output length pseudorandom generators

A deterministic polynomial-time algorithm is a variable output-length pseudorandom generator if:1. Let be a string and an integer. Then outputs a

string of length . 2. For all with the string is a prefix of .

Define . Then for every polynomial it holds that is a pseudorandom generator with expansion factor .

Page 14: CIS 5371   Cryptography

14

Stream ciphers• We can easily modify the earlier construction

for the encryption scheme for variable output length PRG.

• In this case,

Page 15: CIS 5371   Cryptography

Discussion• We use the term • stream cipher

for the PR stream generator, • not the encryption algorithm.

• There are a number of practical constructions of stream ciphers that are extraordinarily fast, such as the stream cipher RC4.

15

Page 16: CIS 5371   Cryptography

Discussion• The WEP encryption protocol for 802.11

used RC4 and was broken.• But since then it is fixed---and the standard

updated.• If RC4 has to be used the first 1024 bits or

so should be discarded.

16

Page 17: CIS 5371   Cryptography

Discussion• From a security point of view it is advocated

to use block cipher constructions for constructing secure encryption schemes.

• This disadvantage is that this approach is less efficient when compared to using a dedicated stream cipher.

17

Page 18: CIS 5371   Cryptography

18

Multi-message eavesdropping experiment

3..

Page 19: CIS 5371   Cryptography

DefinitionA private-key encryption scheme =(Gen,Enc,Dec) that has indistinguishable multiple encryptions in the presence of an eavesdropper satisfies:

: where the probability is taken over the random coins of , and the experiment.

19

Page 20: CIS 5371   Cryptography

Indistinguishable single encryptions vs indistinguishable multi encryptions• The secure fixed length encryption Protocol

presented earlier is deterministic and cannot be used as a construction for a indistinguishable multi encryptions.

• To see why, we use the experiment for the pair of vector messages and

20

Page 21: CIS 5371   Cryptography

Secure multiple encryptions using a stream cipher

• Synchronized mode• Communicating parties use a different

part of the stream cipher output to encrypt a message.

• Useful for parties communicating in the same session.

• Communicating parties must maintain state between encryptions.

21

Page 22: CIS 5371   Cryptography

Secure multiple encryptions using a stream cipher

Unsynchronized mode Encryptions are carried out independently

of one another. Communicating parties are not required to

maintain state between encryptions.

where the initial vector is chosen at random.

22

Page 23: CIS 5371   Cryptography

Security against Chosen-Plaintext Attack (CPA)

We now consider a more powerful adversary that is active.

The adversary can ask for the encryptions of some specific plaintext messages, as well as eavesdrop.

23

Page 24: CIS 5371   Cryptography

24

The CPA indistinguishability experiment

1. . .

Page 25: CIS 5371   Cryptography

Indistinguishable encryptions under CPA

Definition

A private-key encryption scheme has indistinguishable encryptions under CPA if

where the probability is taken over the coins of A and those of the experiment.

25

Page 26: CIS 5371   Cryptography

CPA security for multiple encryptions

As for single encryption, extend the experiment to in which the adversary outputs a pair of vectors of plaintext.

Any private-key encryption scheme that has indistinguishable encryptions under CPA also has indistinguishable multiple encryptions under CPA

26