cryptography symmetric encryption continued hash
play

Cryptography: Symmetric Encryption (continued), Hash - PowerPoint PPT Presentation

CSE 484 / CSE M 584: Computer Security and Privacy Cryptography: Symmetric Encryption (continued), Hash Functions, Message Authentication Codes Spring


  1. CSE ¡484 ¡/ ¡CSE ¡M ¡584: ¡ ¡Computer ¡Security ¡and ¡Privacy ¡ ¡ Cryptography: ¡ ¡ Symmetric ¡Encryption ¡(continued), ¡ Hash ¡Functions, ¡Message ¡Authentication ¡Codes ¡ Spring ¡2015 ¡ ¡ Franziska ¡(Franzi) ¡Roesner ¡ ¡ franzi@cs.washington.edu ¡ Thanks ¡to ¡Dan ¡Boneh, ¡Dieter ¡Gollmann, ¡Dan ¡Halperin, ¡Yoshi ¡Kohno, ¡John ¡Manferdelli, ¡John ¡ Mitchell, ¡Vitaly ¡Shmatikov, ¡Bennet ¡Yee, ¡and ¡many ¡others ¡for ¡sample ¡slides ¡and ¡materials ¡... ¡

  2. Reminders ¡ • Homework ¡#1 ¡due ¡today ¡@5pm ¡ • Checkpoint ¡for ¡lab ¡#1 ¡due ¡Monday ¡@5pm ¡ – Send ¡key ¡to ¡Peter!!!11 ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 2 ¡

  3. Electronic ¡Code ¡Book ¡(ECB) ¡Mode ¡ plaintext ¡ key ¡ key ¡ key ¡ key ¡ key ¡ block ¡ block ¡ block ¡ block ¡ block ¡ cipher ¡ cipher ¡ cipher ¡ cipher ¡ cipher ¡ ciphertext ¡ • Identical ¡blocks ¡of ¡plaintext ¡produce ¡identical ¡blocks ¡of ¡ciphertext ¡ • No ¡integrity ¡checks: ¡can ¡mix ¡and ¡match ¡blocks ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 3 ¡

  4. Cipher ¡Block ¡Chaining ¡(CBC) ¡Mode: ¡Encryption ¡ plaintext ¡ ⊕ ¡ ⊕ ¡ ⊕ ¡ ⊕ ¡ Initialization ¡ vector ¡ key ¡ key ¡ key ¡ key ¡ (random) ¡ block ¡ block ¡ block ¡ block ¡ cipher ¡ cipher ¡ cipher ¡ cipher ¡ Sent ¡with ¡ciphertext ¡ (preferably ¡encrypted) ¡ ciphertext ¡ Identical ¡blocks ¡of ¡plaintext ¡encrypted ¡differently ¡ • Last ¡cipherblock ¡depends ¡on ¡entire ¡plaintext ¡ • Still ¡does ¡not ¡guarantee ¡integrity ¡ • 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 4 ¡

  5. Counter ¡Mode ¡(CTR): ¡Encryption ¡ Initial ¡ctr ¡ ctr ¡ ctr+1 ¡ ctr+2 ¡ ctr+3 ¡ (random) ¡ Key ¡ Key ¡ Key ¡ Key ¡ block ¡ block ¡ block ¡ block ¡ cipher ¡ cipher ¡ cipher ¡ cipher ¡ pt ¡ ¡ pt ¡ pt ¡ pt ¡ ⊕ ⊕ ⊕ ⊕ ciphertext ¡ • Identical ¡blocks ¡of ¡plaintext ¡encrypted ¡differently ¡ • Still ¡does ¡not ¡guarantee ¡integrity; ¡Fragile ¡if ¡ctr ¡repeats ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 5 ¡

  6. Counter ¡Mode ¡(CTR): ¡Decryption ¡ Initial ¡ctr ¡ ctr ¡ ctr+1 ¡ ctr+2 ¡ ctr+3 ¡ Key ¡ Key ¡ Key ¡ Key ¡ block ¡ block ¡ block ¡ block ¡ cipher ¡ cipher ¡ cipher ¡ cipher ¡ ⊕ ¡ ⊕ ¡ ⊕ ¡ ⊕ ¡ ct ¡ ct ¡ ct ¡ ct ¡ pt ¡ pt ¡ pt ¡ pt ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 6 ¡

  7. When ¡is ¡an ¡Encryption ¡Scheme ¡“Secure”? ¡ • Hard ¡to ¡recover ¡the ¡key? ¡ – What ¡if ¡attacker ¡can ¡learn ¡plaintext ¡without ¡learning ¡the ¡ key? ¡ • Hard ¡to ¡recover ¡plaintext ¡from ¡ciphertext? ¡ – What ¡if ¡attacker ¡learns ¡some ¡bits ¡or ¡some ¡function ¡of ¡ bits? ¡ • Fixed ¡mapping ¡from ¡plaintexts ¡to ¡ciphertexts? ¡ – What ¡if ¡attacker ¡sees ¡two ¡identical ¡ciphertexts ¡and ¡infers ¡ that ¡the ¡corresponding ¡plaintexts ¡are ¡identical? ¡ – Implication: ¡encryption ¡must ¡be ¡randomized ¡or ¡stateful ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 7 ¡

  8. How ¡Can ¡a ¡Cipher ¡Be ¡Attacked? ¡ • Attackers ¡knows ¡ciphertext ¡and ¡encryption ¡algthm ¡ – What ¡else ¡does ¡the ¡attacker ¡know? ¡Depends ¡on ¡the ¡ application ¡in ¡which ¡the ¡cipher ¡is ¡used! ¡ ¡ • Ciphertext-­‑only ¡attack ¡ • KPA: ¡Known-­‑plaintext ¡attack ¡(stronger) ¡ – Knows ¡some ¡plaintext-­‑ciphertext ¡pairs ¡ • CPA: ¡Chosen-­‑plaintext ¡attack ¡(even ¡stronger) ¡ – Can ¡obtain ¡ciphertext ¡for ¡any ¡plaintext ¡of ¡his ¡choice ¡ • CCA: ¡Chosen-­‑ciphertext ¡attack ¡(very ¡strong) ¡ – Can ¡decrypt ¡any ¡ciphertext ¡except ¡the ¡target ¡ ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 8 ¡

  9. Chosen ¡Plaintext ¡Attack ¡ PIN ¡is ¡encrypted ¡and ¡ transmitted ¡to ¡bank ¡ cipher(key,PIN) ¡ Crook ¡#2 ¡eavesdrops ¡ on ¡the ¡wire ¡and ¡learns ¡ Crook ¡#1 ¡changes ¡ ciphertext ¡corresponding ¡ his ¡PIN ¡to ¡a ¡number ¡ to ¡chosen ¡plaintext ¡PIN ¡ of ¡his ¡choice ¡ … ¡repeat ¡for ¡any ¡PIN ¡value ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 9 ¡

  10. Very ¡Informal ¡Intuition ¡ Minimum ¡security ¡ ¡ requirement ¡for ¡a ¡ ¡ modern ¡encryption ¡scheme ¡ • Security ¡against ¡chosen-­‑plaintext ¡attack ¡(CPA) ¡ – Ciphertext ¡leaks ¡no ¡information ¡about ¡the ¡plaintext ¡ – Even ¡if ¡the ¡attacker ¡correctly ¡guesses ¡the ¡plaintext, ¡he ¡ cannot ¡verify ¡his ¡guess ¡ – Every ¡ciphertext ¡is ¡unique, ¡encrypting ¡same ¡message ¡ twice ¡produces ¡completely ¡different ¡ciphertexts ¡ • Security ¡against ¡chosen-­‑ciphertext ¡attack ¡(CCA) ¡ – Integrity ¡protection ¡– ¡it ¡is ¡not ¡possible ¡to ¡change ¡the ¡ plaintext ¡by ¡modifying ¡the ¡ciphertext ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 10 ¡

  11. Why ¡Hide ¡Everything? ¡ • Leaking ¡even ¡a ¡little ¡bit ¡of ¡information ¡about ¡the ¡ plaintext ¡can ¡be ¡disastrous ¡ • Electronic ¡voting ¡ – 2 ¡candidates ¡on ¡the ¡ballot ¡(1 ¡bit ¡to ¡encode ¡the ¡vote) ¡ – If ¡ciphertext ¡leaks ¡the ¡parity ¡bit ¡of ¡the ¡encrypted ¡ plaintext, ¡eavesdropper ¡learns ¡the ¡entire ¡vote ¡ • Also, ¡want ¡a ¡strong ¡definition, ¡that ¡implies ¡other ¡ definitions ¡(like ¡not ¡being ¡able ¡to ¡obtain ¡key) ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 11 ¡

  12. Message ¡Authentication ¡Codes ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 12 ¡

  13. So ¡Far: ¡Achieving ¡Privacy ¡ Encryption ¡schemes: ¡ ¡A ¡tool ¡for ¡protecting ¡privacy. ¡ M ¡ C ¡ M ¡ Encrypt ¡ Decrypt ¡ K ¡ K ¡ Alice ¡ Bob ¡ K ¡ K ¡ Message ¡= ¡M ¡ Ciphertext ¡= ¡C ¡ ¡ Adversary ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 13 ¡

  14. Now: ¡Achieving ¡Integrity ¡ Message ¡authentication ¡schemes: ¡ ¡A ¡tool ¡for ¡protecting ¡integrity. ¡ MAC: ¡message ¡authentication ¡code ¡ KEY ¡ KEY ¡ (sometimes ¡called ¡a ¡“tag”) ¡ message, ¡MAC(KEY,message) ¡ ? ¡ message ¡ = ¡ Bob ¡ Alice ¡ Recomputes ¡MAC ¡and ¡verifies ¡whether ¡it ¡is ¡ equal ¡to ¡the ¡MAC ¡attached ¡to ¡the ¡message ¡ Integrity ¡and ¡authentication: ¡only ¡someone ¡who ¡knows ¡ KEY ¡can ¡compute ¡correct ¡MAC ¡for ¡a ¡given ¡message. ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 14 ¡

  15. Reminder: ¡CBC ¡Mode ¡Encryption ¡ plaintext ¡ ⊕ ¡ ⊕ ¡ ⊕ ¡ ⊕ ¡ Initialization ¡ vector ¡ key ¡ key ¡ key ¡ key ¡ (random) ¡ block ¡ block ¡ block ¡ block ¡ cipher ¡ cipher ¡ cipher ¡ cipher ¡ ciphertext ¡ Identical ¡blocks ¡of ¡plaintext ¡encrypted ¡differently ¡ • Last ¡cipherblock ¡depends ¡on ¡entire ¡plaintext ¡ • Still ¡does ¡not ¡guarantee ¡integrity ¡ • 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 15 ¡

  16. CBC-­‑MAC ¡ plaintext ¡ ⊕ ¡ ⊕ ¡ ⊕ ¡ ⊕ ¡ key ¡ key ¡ key ¡ key ¡ block ¡ block ¡ block ¡ block ¡ cipher ¡ cipher ¡ cipher ¡ cipher ¡ TAG ¡ • Not ¡secure ¡when ¡system ¡may ¡MAC ¡messages ¡of ¡ different ¡lengths. ¡ • NIST ¡recommends ¡a ¡derivative ¡called ¡CMAC ¡[FYI ¡only] ¡ 4/17/15 ¡ CSE ¡484 ¡/ ¡CSE ¡M ¡584 ¡-­‑ ¡Spring ¡2015 ¡ 16 ¡

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