symmetric and password based encrypdon cs642 computer
play

Symmetric and Password-based encrypDon CS642: Computer - PowerPoint PPT Presentation

Symmetric and Password-based encrypDon CS642: Computer Security Professor Ristenpart h9p://www.cs.wisc.edu/~rist/ rist at cs dot wisc dot edu University


  1. Symmetric ¡and ¡ ¡ Password-­‑based ¡encrypDon ¡ CS642: ¡ ¡ Computer ¡Security ¡ Professor ¡Ristenpart ¡ h9p://www.cs.wisc.edu/~rist/ ¡ rist ¡at ¡cs ¡dot ¡wisc ¡dot ¡edu ¡ University ¡of ¡Wisconsin ¡CS ¡642 ¡

  2. Symmetric ¡encrypDon ¡ key ¡generaDon ¡ R k ¡ Kg ¡ Handled ¡ in ¡TLS ¡key ¡ exchange ¡ K ¡ OpDonal ¡ R ¡ M ¡or ¡ ¡ Enc ¡ C ¡ C ¡ Dec ¡ error ¡ M ¡ C ¡is ¡a ¡ciphertext ¡ Correctness: ¡ ¡D( ¡K ¡, ¡E(K,M,R) ¡) ¡= ¡M ¡ ¡with ¡probability ¡1 ¡over ¡randomness ¡used ¡

  3. In ¡TLS ¡symmetric ¡encrypDon ¡underlies ¡the ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Record ¡Layer ¡ h9p://amazon.com ¡ K ¡ K ¡ R ¡ M ¡or ¡ ¡ C’ ¡ Dec ¡ Enc ¡ C ¡ error ¡ M ¡ What ¡security ¡properDes ¡do ¡we ¡need ¡from ¡symmetric ¡encrypDon? ¡ 1) ¡ConfidenDality: ¡should ¡not ¡learn ¡any ¡informaDon ¡about ¡M ¡ 2) ¡AuthenDcity: ¡ ¡should ¡not ¡be ¡able ¡to ¡forge ¡messages ¡ O\en ¡referred ¡to ¡as ¡AuthenDcated ¡EncrypDon ¡security ¡ ¡

  4. AcDve ¡security ¡of ¡CBC ¡mode ¡ M1 ¡ M2 ¡ M3 ¡ IV ¡ E K ¡ E K ¡ E K ¡ C0 ¡ C1 ¡ C2 ¡ C3 ¡ What ¡about ¡forging ¡a ¡message? ¡ Pick ¡any ¡C0’, ¡C1’ ¡… ¡ M1’ ¡ M1’ ¡ ¡ ¡ ¡ ¡ ¡D ¡ IV ¡ IV ¡ Be9er ¡yet ¡ for ¡any ¡D: ¡ D K ¡ D K ¡ C0’ ¡ C1’ ¡ C0’ ¡ ¡ ¡ ¡ ¡D ¡ ¡ C1’ ¡

  5. Hash ¡funcDons ¡and ¡message ¡ authenDcaDon ¡ Hash ¡funcDon ¡H ¡maps ¡arbitrary ¡bit ¡string ¡to ¡fixed ¡length ¡string ¡of ¡ size ¡m ¡ ¡ MD5: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡m ¡= ¡128 ¡bits ¡ M ¡ H(M) ¡ SHA-­‑1: ¡ ¡ ¡ ¡ ¡ ¡m ¡= ¡160 ¡bits ¡ H ¡ SHA-­‑256: ¡ ¡m ¡= ¡256 ¡bits ¡ Some ¡security ¡goals: ¡ ¡ ¡ ¡ -­‑ collision ¡resistance: ¡can’t ¡find ¡M ¡!= ¡M’ ¡such ¡that ¡H(M) ¡= ¡H(M’) ¡ -­‑ preimage ¡resistance: ¡given ¡H(M), ¡can’t ¡find ¡M ¡ -­‑ second-­‑preimage ¡resistance: ¡given ¡H(M), ¡can’t ¡find ¡M’ ¡s.t. ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡H(M’) ¡= ¡H(M) ¡

  6. Hash ¡funcDon ¡applicaDon ¡example ¡ Password ¡hashing. ¡Choose ¡random ¡salt ¡and ¡store ¡(salt,h) ¡where: ¡ salt ¡|| ¡pw ¡ h ¡ H ¡ The ¡idea: ¡A9acker, ¡given ¡(salt,h), ¡should ¡not ¡be ¡able ¡to ¡recover ¡pw ¡ Or ¡can ¡they? ¡ Rainbow ¡tables ¡speed ¡this ¡ For ¡each ¡guess ¡pw’: ¡ up ¡in ¡pracDce ¡by ¡way ¡of ¡ ¡ ¡ ¡ ¡ ¡If ¡H(salt||pw’) ¡= ¡h ¡then ¡ ¡ precompuDon. ¡Large ¡salts ¡ ¡ ¡ ¡Ret ¡pw’ ¡ make ¡rainbow ¡tables ¡impracDcal ¡

  7. Message ¡authenDcaDon ¡ key ¡generaDon ¡ R k ¡ Kg ¡ OpDonal. ¡If ¡no ¡ randomness, ¡then ¡called ¡ a ¡Message ¡AuthenDcaDon ¡ ¡ Code ¡(MAC) ¡ K ¡ R ¡ M ¡ Tag ¡ T ¡ Ver ¡ 0 ¡or ¡1 ¡ M ¡ T ¡ Correctness: ¡ ¡Ver( ¡K ¡, ¡Tag(K,M,R) ¡) ¡= ¡1 ¡ ¡with ¡probability ¡1 ¡over ¡randomness ¡used ¡ Unforgeability: ¡A9acker ¡can’t ¡find ¡M’,T ¡such ¡that ¡V(K,M’,T) ¡= ¡1 ¡

  8. Recall ¡PRF ¡security ¡ F: ¡{0,1} k ¡x ¡{0,1} * ¡-­‑> ¡{0,1} n ¡ Security ¡goal: ¡ ¡ ¡ ¡F(K,M) ¡is ¡indisDnguishable ¡from ¡random ¡n-­‑bit ¡string ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡for ¡anyone ¡without ¡K ¡ For ¡M 1 , ¡M 2 , ¡… ¡, ¡M q ¡chosen ¡ U i ¡is ¡fresh ¡n-­‑bit ¡uniform ¡string ¡ by ¡adversary ¡and ¡disDnct ¡ F(K,M 1 ) ¡, ¡F(K,M 2 ), ¡… ¡, ¡F(K,M q ) ¡ ¡ U 1 , ¡U 2 , ¡… ¡, ¡U q ¡ Adversary ¡that ¡adapDvely ¡chooses ¡messages ¡but ¡is ¡limited ¡to ¡ “reasonable” ¡q ¡(e.g., ¡q ¡= ¡2 40 ) ¡can’t ¡disDnguish ¡between ¡two ¡vectors ¡ This ¡means ¡outputs ¡of ¡F ¡are ¡ unpredictable: ¡ ¡ Given ¡F(K,M 1 ) ¡, ¡F(K,M 2 ), ¡… ¡, ¡F(K,M q-­‑1 ) ¡no ¡a9acker ¡can ¡ predict ¡F(K,M q ) ¡with ¡probability ¡1 ¡/ ¡2 n ¡ + ¡negligible ¡

  9. Any ¡PRF ¡is ¡a ¡good ¡MAC ¡ R k ¡ Kg ¡ OpDonal. ¡If ¡no ¡ randomness, ¡then ¡called ¡ a ¡Message ¡AuthenDcaDon ¡ ¡ Code ¡(MAC) ¡ K ¡ R ¡ M ¡ Tag ¡ T ¡ Ver ¡ 0 ¡or ¡1 ¡ M ¡ T ¡ Correctness: ¡ ¡Ver( ¡K ¡, ¡Tag(K,M,R) ¡) ¡= ¡1 ¡ ¡with ¡probability ¡1 ¡over ¡randomness ¡used ¡ Unforgeability: ¡A9acker ¡can’t ¡find ¡M’,T ¡such ¡that ¡V(K,M’,T) ¡= ¡1 ¡

  10. Any ¡PRF ¡is ¡a ¡good ¡MAC ¡ R k ¡ Kg ¡ key ¡generaDon ¡picks ¡uniform ¡key ¡for ¡F ¡ K ¡ M ¡ M ¡ F(K,M) ¡ T ¡ F(K,M) ¡= ¡T? ¡ 0 ¡or ¡1 ¡ T ¡ How ¡do ¡we ¡instanDate ¡F? ¡

  11. Message ¡authenDcaDon ¡with ¡HMAC ¡ Use ¡a ¡hash ¡funcDon ¡H ¡to ¡build ¡a ¡MAC. ¡ ¡ Kg ¡outputs ¡uniform ¡bit ¡string ¡K ¡ Tag(K,M) ¡= ¡HMAC(K,M) ¡ ¡defined ¡by: ¡ ipad ¡!= ¡opad ¡are ¡constants ¡ K ¡ ¡ ¡ ¡ ¡ipad ¡|| ¡M ¡ H ¡ T ¡ K ¡ ¡ ¡ ¡ ¡ ¡opad ¡ ¡|| ¡h ¡ ¡ ¡ H ¡ To ¡verify ¡a ¡M,T ¡pair, ¡check ¡if ¡HMAC(K,M) ¡= ¡T ¡ ¡ Unforgeability ¡holds ¡if ¡H ¡is ¡a ¡secure ¡PRF ¡when ¡so-­‑keyed ¡

  12. Build ¡a ¡new ¡scheme ¡from ¡CBC ¡and ¡HMAC ¡ Kg ¡outputs ¡CBC ¡key ¡K1 ¡and ¡HMAC ¡key ¡K2 ¡ Several ¡ways ¡to ¡combine: ¡ M ¡ (1) ¡ (1) ¡encrypt-­‑then-­‑mac ¡ ¡ (2) ¡mac-­‑then-­‑encrypt ¡ K1 ¡ K2 ¡ CBC ¡ HMAC ¡ (3) ¡encrypt-­‑and-­‑mac ¡ C ¡ T ¡ (3) ¡ M ¡ M ¡ (2) ¡ M ¡|| ¡T ¡ K2 ¡ K2 ¡ K1 ¡ K1 ¡ HMAC ¡ HMAC ¡ CBC ¡ CBC ¡ C ¡ T ¡ C ¡

  13. Build ¡a ¡new ¡scheme ¡from ¡CBC ¡and ¡HMAC ¡ Kg ¡outputs ¡CBC ¡key ¡K1 ¡and ¡HMAC ¡key ¡K2 ¡ Several ¡ways ¡to ¡combine: ¡ M ¡ (1) ¡ (1) ¡encrypt-­‑then-­‑mac ¡ ¡ (2) ¡mac-­‑then-­‑encrypt ¡ K1 ¡ K2 ¡ CBC ¡ HMAC ¡ (3) ¡encrypt-­‑and-­‑mac ¡ C ¡ T ¡ Thm. ¡If ¡encrypDon ¡scheme ¡provides ¡confidenDality ¡against ¡ ¡ passive ¡a9ackers ¡and ¡MAC ¡provides ¡unforgeability, ¡then ¡ ¡ Encrypt-­‑then-­‑MAC ¡provides ¡secure ¡authenDcated ¡encrypDon ¡

  14. TLS ¡record ¡protocol: ¡MAC-­‑Encode-­‑Encrypt ¡(MEE) ¡ ¡ Padding ¡is ¡not ¡MAC’d. ¡ SQN + Payload ImplementaDons ¡must ¡ comp method handle ¡padding ¡checks ¡ ¡ MAC very ¡carefully. ¡ MAC tag Payload Padding Encrypt Header Ciphertext HMAC-­‑MD5, ¡HMAC-­‑SHA1, ¡HMAC-­‑SHA256 ¡ ¡ MAC CBC-­‑AES128, ¡CBC-­‑AES256, ¡CBC-­‑3DES, ¡RC4-­‑128 ¡ Encrypt

  15. Dedicated ¡authenDcated ¡encrypDon ¡schemes ¡ A"ack ¡ Inventors ¡ Notes ¡ OCB ¡ Rogaway ¡ One-­‑pass ¡ (Offset ¡Codebook) ¡ ¡ ¡ GCM ¡ ¡ McGrew, ¡Viega ¡ CTR ¡mode ¡plus ¡specialized ¡MAC ¡ (Galios ¡Counter ¡ Mode) ¡ CWC ¡ Kohno, ¡Viega, ¡WhiDng ¡ CTR ¡mode ¡plus ¡Carter-­‑Wegman ¡ MAC ¡ CCM ¡ Housley, ¡Ferguson, ¡ CTR ¡mode ¡plus ¡CBC-­‑MAC ¡ WhiDng ¡ EAX ¡ ¡ Wagner, ¡Bellare, ¡ CTR ¡mode ¡plus ¡OMAC ¡ ¡ Rogaway ¡

  16. Symmetric ¡EncrypDon ¡Advice ¡ Never ¡use ¡CTR ¡mode ¡or ¡CBC ¡mode ¡by ¡themselves ¡ Passive ¡security ¡is ¡almost ¡never ¡good ¡enough!! ¡ Encrypt-­‑then-­‑MAC ¡be9er ¡than ¡MAC-­‑then-­‑Encrypt, ¡ Encrypt ¡and ¡MAC ¡ Dedicated ¡modes ¡that ¡have ¡been ¡analyzed ¡thoroughly ¡ are ¡also ¡good ¡

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