prf block ciphers mac
play

PRF , Block Ciphers MAC Lecture 6 One-time CPA-secure RECALL SKE - PowerPoint PPT Presentation

PRF , Block Ciphers MAC Lecture 6 One-time CPA-secure RECALL SKE with a Stream-Cipher m (stream) Enc One-time Encryption with a stream-cipher: SC K Generate a one-time pad from a short seed Can share just the seed as the key Mask


  1. Pseudorandom Function (PRF) A PRF can be constructed from any PRG Not blazing fast Faster constructions based on specific number-theoretic computational complexity assumptions Fast heuristic constructions PRF in practice: Block Cipher K BC Extra features/requirements: r Permutation: input block (r) to output block

  2. Pseudorandom Function (PRF) A PRF can be constructed from any PRG Not blazing fast Faster constructions based on specific number-theoretic computational complexity assumptions Fast heuristic constructions PRF in practice: Block Cipher K BC Extra features/requirements: r Permutation: input block (r) to output block Key can be used as an inversion trapdoor

  3. Pseudorandom Function (PRF) A PRF can be constructed from any PRG Not blazing fast Faster constructions based on specific number-theoretic computational complexity assumptions Fast heuristic constructions PRF in practice: Block Cipher K BC Extra features/requirements: r Permutation: input block (r) to output block Key can be used as an inversion trapdoor Pseudorandomness even with access to inversion

  4. CPA-secure SKE with a Block Cipher

  5. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) for a block-cipher (PRF) BC

  6. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) for a block-cipher (PRF) BC For each encryption, Alice will pick a fresh pseudorandom pad, by picking a fresh value r and setting pad=BC K (r)

  7. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) m for a block-cipher (PRF) BC (block) Enc For each encryption, Alice will pick a fresh K BC pseudorandom pad, by picking a fresh value r and ⊕ setting pad=BC K (r) r

  8. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) m for a block-cipher (PRF) BC (block) Enc For each encryption, Alice will pick a fresh K BC pseudorandom pad, by picking a fresh value r and ⊕ setting pad=BC K (r) r Bob needs to be able to generate the same pad, so Alice sends r (in the clear, as part of the ciphertext) to Bob

  9. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) m for a block-cipher (PRF) BC (block) Enc For each encryption, Alice will pick a fresh K BC pseudorandom pad, by picking a fresh value r and ⊕ setting pad=BC K (r) r Bob needs to be able to generate the same pad, so Alice sends r (in the clear, as part of the ciphertext) to Bob

  10. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) m for a block-cipher (PRF) BC (block) Enc For each encryption, Alice will pick a fresh K BC pseudorandom pad, by picking a fresh value r and ⊕ setting pad=BC K (r) r Bob needs to be able to generate the same pad, so Alice sends r (in the clear, as part of the ciphertext) to Bob K BC ⊕ Dec m

  11. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) m for a block-cipher (PRF) BC (block) Enc For each encryption, Alice will pick a fresh K BC pseudorandom pad, by picking a fresh value r and ⊕ setting pad=BC K (r) r Bob needs to be able to generate the same pad, so Alice sends r (in the clear, as part of the ciphertext) to Bob Even if Eve sees r, PRF security guarantees that BC K (r) is pseudorandom. (In fact, Eve could have K BC ⊕ picked r, as long as we ensure no r is reused.) Dec m

  12. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) m for a block-cipher (PRF) BC (block) Enc For each encryption, Alice will pick a fresh K BC pseudorandom pad, by picking a fresh value r and ⊕ setting pad=BC K (r) r Bob needs to be able to generate the same pad, so Alice sends r (in the clear, as part of the ciphertext) to Bob Even if Eve sees r, PRF security guarantees that BC K (r) is pseudorandom. (In fact, Eve could have K BC ⊕ picked r, as long as we ensure no r is reused.) How to pick a fresh r? Dec m

  13. CPA-secure SKE with a Block Cipher Suppose Alice and Bob have shared a key (seed) m for a block-cipher (PRF) BC (block) Enc For each encryption, Alice will pick a fresh K BC pseudorandom pad, by picking a fresh value r and ⊕ setting pad=BC K (r) r Bob needs to be able to generate the same pad, so Alice sends r (in the clear, as part of the ciphertext) to Bob Even if Eve sees r, PRF security guarantees that BC K (r) is pseudorandom. (In fact, Eve could have K BC ⊕ picked r, as long as we ensure no r is reused.) How to pick a fresh r? Pick at random! Dec m

  14. CPA-secure SKE with a Block Cipher

  15. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)?

  16. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)? Chop the message into blocks and independently encrypt each block as before?

  17. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)? Chop the message into blocks and independently encrypt each block as before? Works, but ciphertext size is double that of the plaintext (if |r| is one-block long)

  18. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)? Chop the message into blocks and independently encrypt each block as before? Works, but ciphertext size is double that of the plaintext (if |r| is one-block long) Extend output length of PRF (w/o increasing input length)

  19. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)? Chop the message into blocks and independently encrypt each block as before? Works, but ciphertext size is double that of the plaintext (if |r| is one-block long) Extend output length of PRF (w/o increasing input length) r r ... F K F K F K

  20. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)? Chop the message into blocks and independently encrypt each block as before? Works, but ciphertext size is double that of the plaintext (if |r| is one-block long) Extend output length of PRF (w/o increasing input length) r sequential r ... F K F K F K

  21. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)? Chop the message into blocks and independently encrypt each block as before? Works, but ciphertext size is double that of the plaintext (if |r| is one-block long) Extend output length of PRF (w/o increasing input length) r r sequential r r,1 r,2 r,t ... F K F K F K F K F K F K ...

  22. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)? Chop the message into blocks and independently encrypt each block as before? Works, but ciphertext size is double that of the plaintext (if |r| is one-block long) Extend output length of PRF (w/o increasing input length) input length r r sequential slightly decreased, r r,1 r,2 r,t based on ... F K F K F K F K F K F K an a priori ... limit on t

  23. CPA-secure SKE with a Block Cipher How to encrypt a long message (multiple blocks)? Chop the message into blocks and independently encrypt each block as before? Works, but ciphertext size is double that of the plaintext (if |r| is one-block long) Extend output length of PRF (w/o increasing input length) input length r r sequential slightly decreased, r r,1 r,2 r,t based on ... F K F K F K F K F K F K an a priori ... limit on t Output is indistinguishable from t random blocks (even if input to F K known/chosen)

  24. CPA-secure SKE with a Block Cipher

  25. CPA-secure SKE with a Block Cipher Various “modes” of operation of a Block-cipher (i.e., encryption schemes using a block-cipher). All with one block overhead.

  26. CPA-secure SKE with a Block Cipher Various “modes” of operation of a Block-cipher (i.e., encryption schemes using a block-cipher). All with one block overhead. Output Feedback (OFB) mode: Extend the pseudorandom output using the first construction in the previous slide

  27. CPA-secure SKE with a Block Cipher Various “modes” of operation of a Block-cipher (i.e., encryption schemes using a block-cipher). All with one block overhead. r Output Feedback (OFB) mode: Extend the pseudorandom output using the first construction in the previous slide

  28. CPA-secure SKE with a Block Cipher Various “modes” of operation of a Block-cipher (i.e., encryption schemes using a block-cipher). All with one block overhead. r Output Feedback (OFB) mode: Extend the pseudorandom output using the first construction in the previous slide m 1 ⊕ m 2 ⊕ m t ⊕ c 1 c 2 c t

  29. CPA-secure SKE with a Block Cipher Various “modes” of operation of a Block-cipher (i.e., encryption schemes using a block-cipher). All with one block overhead. r Output Feedback (OFB) mode: Extend the r+1 r+2 r+t pseudorandom output using the first construction in the previous slide F K F K F K ... Counter (CTR) Mode: Similar idea as in the m 1 ⊕ m 2 ⊕ m t ⊕ second construction. No a priori limit on number of blocks in a message. Security from c 1 c 2 c t low likelihood of (r+1,...,r+t) running into (r’+1,...,r’+t’)

  30. CPA-secure SKE with a Block Cipher Various “modes” of operation of a Block-cipher (i.e., encryption schemes using a block-cipher). All with one block overhead. Not a PRF (Why?) r Output Feedback (OFB) mode: Extend the r+1 r+2 r+t pseudorandom output using the first construction in the previous slide F K F K F K ... Counter (CTR) Mode: Similar idea as in the m 1 ⊕ m 2 ⊕ m t ⊕ second construction. No a priori limit on number of blocks in a message. Security from c 1 c 2 c t low likelihood of (r+1,...,r+t) running into (r’+1,...,r’+t’)

  31. CPA-secure SKE with a Block Cipher Various “modes” of operation of a Block-cipher (i.e., encryption schemes using a block-cipher). All with one block overhead. Not a PRF (Why?) r Output Feedback (OFB) mode: Extend the r+1 r+2 r+t pseudorandom output using the first construction in the previous slide F K F K F K ... Counter (CTR) Mode: Similar idea as in the m 1 ⊕ m 2 ⊕ m t ⊕ second construction. No a priori limit on number of blocks in a message. Security from c 1 c 2 c t low likelihood of (r+1,...,r+t) running into m 1 m t m 2 r (r’+1,...,r’+t’) ⊕ ⊕ ⊕ Cipher Block Chaining (CBC) mode: ... F K F K F K Sequential encryption. Decryption uses F K-1 . Ciphertext an integral number of blocks. c 1 c 2 c t

  32. Active Adversary

  33. Active Adversary

  34. Active Adversary An active adversary can inject messages into the channel

  35. Active Adversary An active adversary can inject messages into the channel Eve can send ciphertexts to Bob and get them decrypted

  36. Active Adversary An active adversary can inject messages into the channel Eve can send ciphertexts to Bob and get them decrypted Chosen Ciphertext Attack (CCA)

  37. Active Adversary An active adversary can inject messages into the channel Eve can send ciphertexts to Bob and get them decrypted Chosen Ciphertext Attack (CCA) If Bob decrypts all ciphertexts for Eve, no security possible

  38. Active Adversary An active adversary can inject messages into the channel Eve can send ciphertexts to Bob and get them decrypted Chosen Ciphertext Attack (CCA) If Bob decrypts all ciphertexts for Eve, no security possible What can Bob do?

  39. Symmetric-Key Encryption SIM-CCA Security Key/ Key/ Recv Enc Dec Send Replay SIM-CCA Filter secure if: ∀ ∃ s.t. ∀ REAL ≈ IDEAL Env Env REAL IDEAL

  40. Symmetric-Key Encryption SIM-CCA Security Invalid ciphertexts are silently ignored Key/ Key/ Recv Enc Dec Send Replay SIM-CCA Filter secure if: ∀ ∃ s.t. ∀ REAL ≈ IDEAL Env Env REAL IDEAL

  41. Symmetric-Key Encryption IND-CCA + ~correctness IND-CCA Security equivalent to SIM-CCA Experiment picks b ← {0,1} and K ← KeyGen Enc(m b ,K) Adv gets (guarded) access to Dec K oracle Key/ Key/ Enc Dec For as long as Adversary wants Adv sends two messages m 0 , m 1 m b to the experiment Replay Filter: No challenge Expt returns Enc(m b ,K) to the ciphertext answered adversary m 0 ,m 1 b’ Adversary returns a guess b’ b b ← {0,1} Experiments outputs 1 iff b’=b b’=b? IND-CCA secure if for all feasible adversaries Pr[b’=b] ≈ 1/2 Yes/No

  42. CCA Security

  43. CCA Security How to obtain CCA security?

  44. CCA Security How to obtain CCA security? Use a CPA-secure encryption scheme, but make sure Bob “accepts” and decrypts only ciphertexts produced by Alice

  45. CCA Security How to obtain CCA security? Use a CPA-secure encryption scheme, but make sure Bob “accepts” and decrypts only ciphertexts produced by Alice i.e., Eve can’ t create new ciphertexts that will be accepted by Bob

  46. CCA Security How to obtain CCA security? Use a CPA-secure encryption scheme, but make sure Bob “accepts” and decrypts only ciphertexts produced by Alice i.e., Eve can’ t create new ciphertexts that will be accepted by Bob Achieves the stronger guarantee: in IDEAL, Eve can’ t send its own messages to Bob

  47. CCA Security How to obtain CCA security? Use a CPA-secure encryption scheme, but make sure Bob “accepts” and decrypts only ciphertexts produced by Alice i.e., Eve can’ t create new ciphertexts that will be accepted by Bob Achieves the stronger guarantee: in IDEAL, Eve can’ t send its own messages to Bob CCA secure SKE reduces to the problem of CPA secure SKE and (shared key) message authentication

  48. CCA Security How to obtain CCA security? Use a CPA-secure encryption scheme, but make sure Bob “accepts” and decrypts only ciphertexts produced by Alice i.e., Eve can’ t create new ciphertexts that will be accepted by Bob Achieves the stronger guarantee: in IDEAL, Eve can’ t send its own messages to Bob CCA secure SKE reduces to the problem of CPA secure SKE and (shared key) message authentication MAC: Message Authentication Code

  49. Message Authentication Codes

  50. Message Authentication Codes A single short key shared by Alice and Bob

  51. Message Authentication Codes A single short key shared by Alice and Bob Can sign any (polynomial) number of messages

  52. Message Authentication Codes A single short key shared by Alice and Bob Can sign any (polynomial) number of MAC K Ver K messages A triple (KeyGen, MAC, Verify)

  53. Message Authentication Codes A single short key shared by Alice and Bob Can sign any (polynomial) number of MAC K Ver K messages A triple (KeyGen, MAC, Verify) Correctness: For all K from KeyGen, and all messages M, Verify K (M,MAC K (M))=1

  54. Message Authentication Codes A single short key shared by Alice and Bob Can sign any (polynomial) number of MAC K Ver K messages s i = MAC K (M i ) Ver K (M,s) A triple (KeyGen, MAC, Verify) (M,s) M i Correctness: For all K from KeyGen, and all messages M, Verify K (M,MAC K (M))=1 Advantage Security: probability that an adversary can = Pr[ Ver K (M,s)=1 and produce (M,s) s.t. Verify K (M,s)=1 is negligible (M,s) ∉ {(M i ,s i )} ] unless Alice produced an output s=MAC K (M)

  55. CCA Secure SKE

  56. CCA Secure SKE CCA-Enc K1,K2 (m) = ( c:= CPA-Enc K1 (m), t:= MAC K2 (c) )

  57. CCA Secure SKE CCA-Enc K1,K2 (m) = ( c:= CPA-Enc K1 (m), t:= MAC K2 (c) ) CPA secure encryption: Block-cipher/CTR mode construction

  58. CCA Secure SKE CCA-Enc K1,K2 (m) = ( c:= CPA-Enc K1 (m), t:= MAC K2 (c) ) CPA secure encryption: Block-cipher/CTR mode construction MAC: from a PRF or Block-Cipher (next time)

Recommend


More recommend