using block ciphers review prps and prfs
play

Using block ciphers Review: PRPs and PRFs Dan Boneh - PowerPoint PPT Presentation

Online Cryptography Course


  1. Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡ Using ¡block ¡ciphers ¡ Review: ¡PRPs ¡and ¡PRFs ¡ Dan ¡Boneh ¡

  2. Block ¡ciphers: ¡ ¡crypto ¡work ¡horse ¡ n bits n bits E, D PT Block CT Block Key k bits Canonical examples: 1. 3DES: n= 64 bits, k = 168 bits 2. AES: n=128 bits, k = 128, 192, 256 bits Dan ¡Boneh ¡

  3. Abstractly: ¡ ¡ ¡PRPs ¡and ¡PRFs ¡ • Pseudo ¡Random ¡FuncAon ¡ ¡ ¡( PRF ) ¡ ¡ ¡ ¡ defined ¡over ¡(K,X,Y): ¡ ¡ ¡ ¡F: ¡ ¡K ¡ × ¡X ¡ ¡ → ¡ ¡Y ¡ ¡ ¡ ¡ ¡ ¡such ¡that ¡exists ¡“efficient” ¡algorithm ¡to ¡evaluate ¡F(k,x) ¡ • Pseudo ¡Random ¡PermutaAon ¡ ¡ ¡( PRP ) ¡ ¡ ¡ ¡ defined ¡over ¡(K,X): ¡ ¡ ¡ ¡E: ¡ ¡ ¡K ¡ × ¡X ¡ ¡ → ¡ ¡X ¡ ¡ ¡ ¡ ¡ ¡ ¡such ¡that: ¡ ¡1. ¡Exists ¡“efficient” ¡determinisAc ¡algorithm ¡to ¡evaluate ¡ ¡E(k,x) ¡ ¡ ¡2. ¡The ¡funcAon ¡ ¡ ¡E( ¡k, ¡ ⋅ ¡) ¡ ¡ ¡is ¡ ¡one-­‑to-­‑one ¡ ¡ ¡3. ¡Exists ¡“efficient” ¡inversion ¡algorithm ¡ ¡ ¡D(k,x) ¡ Dan ¡Boneh ¡

  4. Secure ¡PRFs ¡ • Let ¡ ¡ ¡F: ¡ ¡K ¡ × ¡X ¡ ¡ → ¡ ¡Y ¡ ¡ ¡be ¡a ¡PRF ¡ ¡ ¡Funs[X,Y]: ¡ ¡ ¡ ¡ ¡the ¡set ¡of ¡ all ¡funcAons ¡from ¡X ¡to ¡Y ¡ ¡ ¡S F ¡= ¡ ¡{ ¡ ¡F(k, ⋅ ) ¡ ¡ ¡s.t. ¡ ¡ ¡k ¡ ∈ ¡K ¡ ¡} ¡ ¡ ¡ ¡ ¡ ¡ ⊆ ¡ ¡ ¡ ¡ ¡Funs[X,Y] ¡ • IntuiAon: ¡ ¡ ¡a ¡PRF ¡is ¡ secure ¡if ¡ ¡ ¡a ¡random ¡funcAon ¡in ¡Funs[X,Y] ¡is ¡indisAnguishable ¡from ¡ ¡ ¡a ¡random ¡funcAon ¡in ¡S F ¡ S F ¡ Funs[X,Y] ¡ |X| ¡ Size ¡|Y| Size ¡|K| ¡ Dan ¡Boneh ¡

  5. Secure ¡PRF: ¡ ¡definiAon ¡ • For ¡ ¡ ¡b=0,1 ¡ ¡ ¡define ¡experiment ¡ ¡ ¡EXP(b) ¡ ¡as: ¡ b ¡ b=0: ¡ ¡ ¡k ← K, ¡ ¡f ¡ ← F(k, ⋅ ) ¡ Chal. ¡ Adv. ¡A ¡ b=1: ¡ ¡ ¡f ← Funs[X,Y] ¡ , ¡x 2 ¡ ¡ , ¡…, ¡x q ¡ x 1 ¡ ∈ ¡X ¡ f ¡ , ¡…, ¡f(x q ) ¡ f(x 1 ) ¡ , ¡f(x 2 ) ¡ ¡ b’ ¡ ∈ ¡{0,1} ¡ • Def: ¡ ¡F ¡is ¡a ¡secure ¡PRF ¡if ¡for ¡all ¡“efficient” ¡ ¡A: ¡ EXP(b) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Adv PRF [A,F] ¡ ¡:= ¡ ¡ | Pr[EXP(0)=1] ¡– ¡Pr[EXP(1)=1] ¡ | ¡ ¡ ¡is ¡“negligible.” ¡ Dan ¡Boneh ¡

  6. Secure ¡PRP ¡ ¡ ¡ (secure ¡block ¡cipher) ¡ • For ¡ ¡ ¡b=0,1 ¡ ¡ ¡define ¡experiment ¡ ¡ ¡EXP(b) ¡ ¡as: ¡ b ¡ b=0: ¡ ¡ ¡k ← K, ¡ ¡f ¡ ← E(k, ⋅ ) ¡ Chal. ¡ Adv. ¡A ¡ b=1: ¡ ¡ ¡f ← Perms[X] ¡ , ¡x 2 , ¡ ¡ ¡…, ¡ ¡x q ¡ x 1 ¡ ∈ ¡X ¡ f ¡ f(x 1 ) ¡ , ¡f(x 2 ), ¡…, ¡f(x q ) ¡ b’ ¡ ∈ ¡{0,1} ¡ • Def: ¡ ¡E ¡is ¡a ¡secure ¡PRP ¡if ¡for ¡all ¡“efficient” ¡ ¡A: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Adv PRP [A,E] ¡ ¡= ¡ ¡ | Pr[EXP(0)=1] ¡– ¡Pr[EXP(1)=1] ¡ | ¡ ¡ ¡is ¡“negligible.” ¡ Dan ¡Boneh ¡

  7. Let ¡ ¡X ¡= ¡{0,1}. ¡ ¡ ¡ ¡Perms[X] ¡ ¡contains ¡two ¡funcAons ¡ ¡ ¡ Consider ¡the ¡following ¡PRP: ¡ ¡ ¡ ¡ ¡ ¡ ¡key ¡space ¡K={0,1}, ¡ ¡ ¡input ¡space ¡X ¡= ¡{0,1}, ¡ ¡ ¡ ¡ ¡ ¡PRP ¡defined ¡as: ¡ E(k,x) ¡= ¡x ⨁ k ¡ ¡ ¡ ¡ ¡ Is ¡this ¡a ¡secure ¡PRP? ¡ Yes ¡ No ¡ It ¡depends ¡

  8. Example ¡secure ¡PRPs ¡ • PRPs ¡believed ¡to ¡be ¡secure: ¡ ¡ ¡ ¡ ¡ ¡3DES, ¡ ¡ ¡AES, ¡ ¡ ¡… ¡ ¡ ¡ AES-­‑128: ¡ ¡ ¡K ¡ × ¡X ¡ ¡ → ¡ ¡X ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡where ¡ ¡ ¡ ¡ ¡ ¡K ¡= ¡X ¡= ¡{0,1} 128 ¡ ¡ ¡ • An ¡example ¡concrete ¡assumpAon ¡about ¡AES: ¡ ¡ ¡ ¡ ¡All ¡ ¡2 80 –Ame ¡ ¡algs. ¡A ¡have ¡ ¡ ¡ ¡Adv PRP [A, ¡ AES ] ¡< ¡2 -­‑40 ¡ ¡ Dan ¡Boneh ¡

  9. Consider ¡the ¡1-­‑bit ¡PRP ¡from ¡the ¡previous ¡quesAon: ¡ E(k,x) ¡= ¡x ⨁ k ¡ ¡ Is ¡it ¡a ¡secure ¡PRF? ¡ ¡ Note ¡that ¡ ¡Funs[X,X] ¡ ¡contains ¡four ¡funcAons ¡ ¡ Yes ¡ No ¡ Akacker ¡A: ¡ ¡ ¡ ¡ It ¡depends ¡ (1) query ¡f( ⋅ ) ¡at ¡ ¡x=0 ¡and ¡x=1 ¡ (2) if ¡f(0) ¡= ¡f(1) ¡output ¡“1”, ¡else ¡“0” ¡ Adv PRF [A,E] ¡= ¡|0-­‑½| ¡= ¡½ ¡ ¡ ¡ ¡

  10. PRF ¡Switching ¡Lemma ¡ Any ¡secure ¡PRP ¡is ¡also ¡a ¡secure ¡PRF, ¡ ¡ ¡if ¡|X| ¡is ¡sufficiently ¡large. ¡ Lemma: ¡ ¡ ¡ ¡ ¡Let ¡ ¡ ¡E ¡ ¡ ¡be ¡a ¡PRP ¡over ¡ ¡(K,X) ¡ ¡ ¡Then ¡for ¡any ¡ ¡ ¡q-­‑query ¡ ¡adversary ¡ ¡A: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ | ¡Adv PRF ¡[A,E] ¡ ¡ - ¡ ¡Adv PRP [A,E] ¡ | ¡ ¡ ¡< ¡ ¡ ¡q 2 ¡/ ¡2|X| ¡ ¡ ⇒ ¡ ¡Suppose ¡|X| ¡is ¡large ¡so ¡that ¡ ¡ ¡ ¡q 2 ¡/ ¡2|X| ¡ ¡ ¡ ¡ ¡is ¡“negligible” ¡ ¡ Then ¡ ¡ ¡ ¡Adv PRP ¡[A,E] ¡ ¡“negligible” ¡ ¡ ¡ ⇒ ¡ ¡ ¡Adv PRF [A,E] ¡“negligible” ¡ Dan ¡Boneh ¡

  11. Final ¡note ¡ • SuggesAon: ¡ ¡ ¡ – don’t ¡think ¡about ¡the ¡inner-­‑workings ¡of ¡AES ¡and ¡3DES. ¡ • We ¡assume ¡both ¡are ¡secure ¡PRPs ¡and ¡will ¡ ¡ see ¡how ¡to ¡use ¡them ¡ Dan ¡Boneh ¡

  12. End ¡of ¡Segment ¡ Dan ¡Boneh ¡

  13. Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡ Using ¡block ¡ciphers ¡ Modes ¡of ¡operaAon: ¡ one ¡Ame ¡key ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡example: ¡ ¡ ¡ ¡encrypted ¡email, ¡new ¡key ¡for ¡every ¡message. ¡ Dan ¡Boneh ¡

  14. Using ¡PRPs ¡and ¡PRFs ¡ Goal: ¡ ¡build ¡“secure” ¡encrypAon ¡from ¡a ¡secure ¡PRP ¡ ¡ ¡(e.g. ¡AES). ¡ This ¡segment: ¡ ¡ ¡ ¡ one-­‑8me ¡keys ¡ 1. Adversary’s ¡power: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Adv ¡sees ¡only ¡one ¡ciphertext ¡ ¡ ¡(one-­‑Ame ¡key) ¡ 2. Adversary’s ¡goal: ¡ ¡ ¡ ¡ ¡ ¡ ¡Learn ¡info ¡about ¡PT ¡from ¡CT ¡ ¡ ¡(semanAc ¡security) ¡ ¡ Next ¡segment: ¡ ¡ ¡many-­‑Ame ¡keys ¡ ¡ ¡(a.k.a ¡ ¡chosen-­‑plaintext ¡security) ¡ Dan ¡Boneh ¡

  15. Incorrect ¡use ¡of ¡a ¡PRP ¡ Electronic ¡Code ¡Book ¡(ECB): ¡ PT: m 1 ¡ m 2 ¡ c 2 ¡ CT: c 1 ¡ Problem: ¡ ¡ ¡ ¡ – if ¡ ¡ ¡ ¡m 1 =m 2 ¡ ¡ ¡ ¡ ¡then ¡ ¡ ¡c 1 =c 2 ¡ Dan ¡Boneh ¡

  16. In ¡pictures ¡ (courtesy ¡B. ¡Preneel) ¡ Dan ¡Boneh ¡

  17. SemanAc ¡Security ¡(one-­‑Ame ¡key) ¡ m 0 ¡, ¡m 1 ¡ ¡ ∈ ¡M ¡: ¡ ¡ ¡ ¡|m 0 | ¡= ¡|m 1 | ¡ EXP(0): ¡ Chal. ¡ Adv. ¡A ¡ c ¡ ← ¡E(k , m 0 ) ¡ k ← K ¡ b’ ¡ ∈ ¡{0,1} ¡ one ¡Ame ¡key ¡ ¡ ⇒ ¡ ¡ ¡adversary ¡sees ¡only ¡one ¡ciphertext ¡ m 0 ¡, ¡m 1 ¡ ¡ ∈ ¡M ¡: ¡ ¡ ¡ ¡|m 0 | ¡= ¡|m 1 | ¡ Chal. ¡ Adv. ¡A ¡ EXP(1): ¡ c ¡ ← ¡E(k , m 1 ) ¡ k ← K ¡ b’ ¡ ∈ ¡{0,1} ¡ Adv SS [A,OTP] ¡= ¡ | ¡Pr[ ¡ EXP(0) =1 ¡] ¡− ¡ ¡Pr[ ¡ EXP(1) =1 ¡] ¡ | ¡ ¡ ¡should ¡be ¡“neg.” ¡ Dan ¡Boneh ¡

  18. ECB ¡is ¡not ¡SemanAcally ¡Secure ¡ ECB ¡is ¡not ¡semanAcally ¡secure ¡for ¡messages ¡that ¡contain ¡ ¡ more ¡than ¡one ¡block. ¡ b ∈ {0,1} ¡ Two ¡blocks ¡ m 0 = “Hello World” Chal. ¡ Adv. ¡ ¡A ¡ m 1 = “Hello Hello” k ← K ¡ (c 1 ,c 2 ) ¡ ← ¡E(k, ¡ m b ) ¡ If ¡ ¡c 1 =c 2 ¡output ¡0, ¡ ¡else ¡output ¡1 ¡ Then ¡ ¡Adv SS ¡[A, ¡ECB] ¡= ¡1 ¡ ¡ Dan ¡Boneh ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend