Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 5371 Cryptography 3b. Pseudorandomness.

Similar presentations


Presentation on theme: "CIS 5371 Cryptography 3b. Pseudorandomness."β€” Presentation transcript:

1 CIS 5371 Cryptography 3b. Pseudorandomness.
Based on: Jonathan Katz and Yehuda Lindell Introduction to Modern 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.

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.

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.

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.

6 Pseudorandomness Definition
Let 𝑙(βˆ™) be a polynomial and 𝐺 a deterministic polynomial-time algorithm that on input any 𝑠 πœ– {0,1 } 𝑛 will output string of length 𝑙(𝑛). 𝐺 is a pseudorandom generator if: 𝑙 𝑛 >𝑛 βˆ€ PPT distinguishers D, βˆƒ π‘Ž negl function with: | Pr 𝐷 π‘Ÿ =1 βˆ’ Pr 𝐷 𝐺 𝑠 =1 ≀negl(n) 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 π‘Ÿ,𝑠.

7 A secure fixed length encryption scheme
π‘˜ π‘π‘™π‘Žπ‘–π‘›π‘‘π‘’π‘₯𝑑 π‘π‘–π‘β„Žπ‘’π‘Ÿπ‘‘π‘’π‘₯𝑑 𝑋𝑂𝑅 π‘π‘ π‘’π‘’π‘‘π‘œπ‘Ÿπ‘Žπ‘›π‘‘π‘œπ‘š π‘”π‘’π‘›π‘’π‘Ÿπ‘Žπ‘‘π‘œπ‘Ÿ π‘π‘Žπ‘‘

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 1 𝑛 choose π‘˜  {0,1 } 𝑛 uniformly at random and output π‘˜ as key. Enc: on input a key π‘˜ οƒŽ {0,1 } 𝑛 and a message mοƒŽ{0,1 } 𝑙(𝑛) output the ciphertext 𝑐≔G π‘˜ οƒ… π‘š . Dec: on input a key π‘˜ οƒŽ {0,1 } 𝑛 and a ciphertext cοƒŽ{0,1 } 𝑙(𝑛) output the plaintext π‘šβ‰”G π‘˜ οƒ… 𝑐 .

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.

10 A secure fixed length encryption Reduction
Adversary A’ (Distinguisher D) Adversary A (Protocol ) 𝑀 1 𝑛 π‘š 0 , π‘š 1 choose a random bit 𝑏 compute 𝑐 𝑏 := w οƒ… π‘š 𝑏 Suppose that A succeeds with probability πœ€(𝑛) 𝑐 𝑏 1 if 𝑏 β€² =𝑏 𝑏′ 0 if 𝑏 β€² ο‚Ή 𝑏

11 A secure fixed length encryption Proof
Let πœ€ 𝑛 = Pr[Priv K eav (𝐴, ) 𝑛 =1]βˆ’ Then, when 𝑀 is uniform random we have Pr 𝐷 𝑀 =1 =Pr[Priv K eav (𝐴, ) 𝑛 =1]= when 𝑀=𝐺(π‘˜) we have Pr 𝐷 𝑀 =1 = Pr 𝐷 𝐺 π‘˜ =1 = Pr[Priv K eav (𝐴, ) 𝑛 =1]= πœ€(𝑛).

12 A secure fixed length encryption Proof
Therefore when 𝑀 is chosen uniformly in {0,1 } 𝑙 𝑛 : |Pr 𝐷 𝑀 =1 βˆ’Pr⁑[𝐷 𝐺 π‘˜ =1]|= ο₯(𝑛) .

13 Variable output length pseudorandom generators
A deterministic polynomial-time algorithm 𝐺 is a variable output-length pseudorandom generator if: Let 𝑠 be a string and 𝑙>0 an integer. Then 𝐺 𝑠, 1 𝑙 outputs a string of length 𝑙. For all 𝑠,𝑙,𝑙′ with 𝑙< 𝑙 β€² , the string 𝐺 𝑠, 1 𝑙 is a prefix of 𝐺 𝑠, 1 𝑙 β€² . Define 𝐺 𝑙 𝑠 ≝ 𝐺 𝑠, 1 𝑙(|𝑠|) . Then for every polynomial it holds that 𝐺 𝑙 𝑠, 1 𝑙 is a pseudorandom generator with expansion factor 𝑙.

14 Stream ciphers We can easily modify the earlier construction for the encryption scheme  for variable output length PRG. In this case, 𝑐≔G π‘˜, 1 π‘š οƒ… π‘š . π‘šβ‰”G π‘˜, 1 |𝑐| οƒ… 𝑐 .

15 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.

16 Discussion The WEP encryption protocol for 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.

17 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.

18 Multi-message eavesdropping experiment Priv K mult (𝐴,)(𝑛)
The adversary 𝐴 is given input 1 𝑛 and outputs a pair of vectors of messages π‘š 0 1 ,…, π‘š 0 𝑑 and π‘š 1 1 ,…, π‘š 1 𝑑 witβ„Ž |π‘š 0 𝑖 = π‘š 1 𝑖 | for all 𝑖. A key π‘˜ is generated runnng 𝐺𝑒𝑛 1 𝑛 and a random bit π‘βˆˆ 0,1 is chosen. For all 𝑖 the ciphertext 𝑐 𝑖  En 𝑐 π‘˜ π‘š 𝑏 𝑖 is computed and the vector of ciphertexts 𝑐 𝑏 1 , …, 𝑐 𝑏 𝑑 is given to 𝐴. .𝐴 outputs a bit 𝑏 β€² . The output of the experiment i𝑠 1 if 𝑏 =𝑏 β€² and 0 otherwise.

19 Definition ο€’ PPT Adversary 𝐴, ο€€ a negligible function negl:
A private-key encryption scheme =(Gen,Enc,Dec) that has indistinguishable multiple encryptions in the presence of an eavesdropper satisfies: ο€’ PPT Adversary 𝐴, ο€€ a negligible function negl: Pr⁑[Priv K mult (𝐴, ) 𝑛 =1] ≀ negl 𝑛 , where the probability is taken over the random coins of 𝐴, and the experiment.

20 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 Priv K mult for the pair of vector messages ( 0 𝑛 , 0 𝑛 ) and 0 𝑛 , 1 𝑛 .

21 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.

22 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 𝐼𝑉  {0,1} 𝑛 is chosen at random.

23 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.

24 The CPA indistinguishability experiment Priv K cpa (𝐴,)(𝑛)
A key π‘˜ is generated runnng Gen 1 𝑛 . The adversary 𝐴 is given input 1 𝑛 and oracle access to En 𝑐 π‘˜ βˆ™ , .and outputs a pair of messages π‘š 0 , π‘š 1 of equal length. A random bit 𝑏 οƒŽ 0,1 is chosen and a ciphertext c  En 𝑐 π‘˜ π‘š 𝑏 is computed and given to 𝐴. Adversary 𝐴 continues to have oracle access to En 𝑐 π‘˜ βˆ™ , and outputs a bit 𝑏 β€² . The output of the experiment i𝑠 1 if 𝑏 =𝑏 β€² and 0 otherwise.

25 Indistinguishable encryptions under CPA Definition
A private-key encryption scheme = Gen,Enc,Dec has indistinguishable encryptions under CPA if βˆ€ PPT adversaries 𝐴, βˆƒ a negl function such that, Pr⁑[Priv Kcpa 𝐴,  𝑛 =1] ≀ negl 𝑛 , where the probability is taken over the coins of A and those of the experiment.

26 CPA security for multiple encryptions
As for single encryption, extend the experiment to Priv K cpa 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


Download ppt "CIS 5371 Cryptography 3b. Pseudorandomness."

Similar presentations


Ads by Google