Ac,ve a4acks on CPA-secure encryp,on Dan Boneh Recap: - - PowerPoint PPT Presentation

ac ve a4acks on cpa secure encryp on
SMART_READER_LITE
LIVE PREVIEW

Ac,ve a4acks on CPA-secure encryp,on Dan Boneh Recap: - - PowerPoint PPT Presentation

Online Cryptography Course


slide-1
SLIDE 1

Dan ¡Boneh ¡

Authen,cated ¡Encryp,on ¡

Ac,ve ¡a4acks ¡on ¡ ¡ CPA-­‑secure ¡encryp,on ¡

Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡

slide-2
SLIDE 2

Dan ¡Boneh ¡

Recap: ¡ ¡the ¡story ¡so ¡far ¡

Confiden'ality: ¡ ¡ ¡ ¡seman,c ¡security ¡against ¡a ¡CPA ¡a4ack ¡

  • Encryp,on ¡secure ¡against ¡eavesdropping ¡only ¡

Integrity: ¡

  • Existen,al ¡unforgeability ¡under ¡a ¡chosen ¡message ¡a4ack ¡
  • CBC-­‑MAC, ¡ ¡HMAC, ¡ ¡PMAC, ¡ ¡CW-­‑MAC ¡

This ¡module: ¡ ¡ ¡encryp,on ¡secure ¡against ¡tampering ¡

  • Ensuring ¡both ¡confiden,ality ¡and ¡integrity ¡ ¡
slide-3
SLIDE 3

Dan ¡Boneh ¡

Sample ¡tampering ¡a4acks ¡

TCP/IP: ¡ ¡ ¡(highly ¡abstracted) ¡ ¡

WWW ¡ port ¡= ¡80 ¡ Bob ¡ port ¡= ¡25 ¡ dest ¡= ¡80 ¡ ¡ ¡ ¡ ¡ ¡data ¡ packet ¡ source ¡machine ¡ des,na,on ¡machine ¡ TCP/IP ¡ stack ¡

slide-4
SLIDE 4

Dan ¡Boneh ¡

Sample ¡tampering ¡a4acks ¡

IPsec: ¡ ¡(highly ¡abstracted) ¡ ¡

WWW ¡ port ¡= ¡80 ¡ Bob ¡ port ¡= ¡25 ¡

k ¡ k ¡

dest ¡= ¡80 ¡ ¡ ¡ ¡ ¡ ¡data ¡ packet ¡

packets ¡encrypted ¡ using ¡key ¡k ¡

TCP/IP ¡ stack ¡ ¡ ¡ ¡ ¡dest ¡= ¡25 ¡ ¡ ¡ ¡ ¡ ¡stuff ¡ stuff ¡

slide-5
SLIDE 5

Dan ¡Boneh ¡

Reading ¡someone ¡else’s ¡data ¡

WWW ¡ port ¡= ¡80 ¡ Bob ¡ port ¡= ¡25 ¡

k ¡ k ¡

dest ¡= ¡80 ¡ ¡ ¡ ¡ ¡ ¡data ¡

Easy ¡to ¡do ¡for ¡CBC ¡with ¡rand. ¡IV ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡(only ¡IV ¡is ¡changed) ¡

Note: ¡ ¡a4acker ¡obtains ¡decryp,on ¡of ¡any ¡ciphertext ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡beginning ¡with ¡“dest=25” ¡ ¡

¡ ¡ ¡ ¡dest ¡= ¡25 ¡ ¡ ¡ ¡ ¡ ¡data ¡ Bob: ¡

IV, ¡ IV’, ¡

slide-6
SLIDE 6

dest ¡= ¡80 ¡ ¡ ¡ ¡ ¡ ¡data ¡ ¡ ¡ ¡ ¡dest ¡= ¡25 ¡ ¡ ¡ ¡ ¡ ¡data ¡

IV ¡, ¡ IV’ ¡, ¡

Encryp,on ¡is ¡done ¡with ¡CBC ¡with ¡a ¡random ¡IV. ¡ ¡ What ¡should ¡IV’ ¡be? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ IV’ ¡= ¡IV ¡⨁ ¡(…25…) ¡ ¡ IV’ ¡= ¡IV ¡⨁ ¡(…80…) ¡ IV’ ¡= ¡IV ¡⨁ ¡(…80…) ¡⨁ ¡(…25…) ¡ ¡ It ¡can’t ¡be ¡done ¡ m[0] ¡= ¡D(k, ¡c[0]) ¡⨁ ¡IV ¡ ¡= ¡“dest=80…” ¡ ¡ ¡ ¡ ¡ ¡

slide-7
SLIDE 7

Dan ¡Boneh ¡

An ¡a4ack ¡using ¡only ¡network ¡access ¡

k ¡ k ¡ Remote ¡terminal ¡app.: ¡ ¡ ¡ ¡each ¡keystroke ¡encrypted ¡with ¡CTR ¡mode ¡ ¡

TCP/IP ¡packet ¡ ¡ ¡IP ¡hdr ¡ ¡ ¡ ¡TCP ¡hdr ¡ ¡ ¡ ¡ 16 ¡bit ¡TCP ¡checksum ¡ 1 ¡byte ¡keystroke ¡ ¡ ¡IP ¡hdr ¡ ¡ ¡ ¡TCP ¡hdr ¡ ¡ ¡ ¡ ⨁ ¡t ¡ ⨁ ¡s ¡

for ¡all ¡t, ¡s ¡send: ¡

ACK ¡if ¡valid ¡checksum, ¡ ¡nothing ¡otherwise ¡ { ¡ ¡ ¡checksum(hdr, ¡D) ¡ ¡= ¡t ¡⨁ ¡checksum(hdr, ¡D⨁s) ¡ ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡⇒ ¡ ¡ ¡can ¡find ¡ ¡D ¡ ¡

D ¡ T ¡

slide-8
SLIDE 8

Dan ¡Boneh ¡

The ¡lesson ¡

CPA ¡security ¡cannot ¡guarantee ¡secrecy ¡under ¡ac,ve ¡a4acks. ¡ ¡ Only ¡use ¡one ¡of ¡two ¡modes: ¡

  • If ¡message ¡needs ¡integrity ¡but ¡no ¡confiden,ality: ¡

¡ ¡use ¡a ¡MAC ¡

  • If ¡message ¡needs ¡both ¡integrity ¡and ¡confiden,ality: ¡

¡ ¡use ¡authen'cated ¡encryp'on ¡modes ¡(this ¡module) ¡

slide-9
SLIDE 9

Dan ¡Boneh ¡

End ¡of ¡Segment ¡

slide-10
SLIDE 10

Dan ¡Boneh ¡

Authen,cated ¡Encryp,on ¡

Defini,ons ¡

Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡

slide-11
SLIDE 11

Dan ¡Boneh ¡

Goals ¡

An ¡authen'cated ¡encryp'on ¡system ¡(E,D) ¡is ¡a ¡cipher ¡where ¡ ¡ ¡As ¡usual: ¡ ¡ ¡ ¡ ¡E: ¡ ¡K ¡× ¡M ¡× ¡N ¡⟶ ¡C ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡but ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡D: ¡ ¡K ¡× ¡C ¡× ¡N ¡⟶ ¡ ¡M ¡∪{⊥} ¡ ¡ Security: ¡ ¡ ¡the ¡system ¡must ¡provide ¡

  • sem. ¡security ¡under ¡a ¡CPA ¡a4ack, ¡ ¡and ¡
  • ciphertext ¡integrity: ¡ ¡ ¡

¡ ¡ ¡ ¡a4acker ¡cannot ¡create ¡new ¡ciphertexts ¡that ¡decrypt ¡properly ¡

ciphertext ¡ is ¡rejected ¡

slide-12
SLIDE 12

Dan ¡Boneh ¡

Ciphertext ¡integrity ¡

Let ¡ ¡(E,D) ¡ ¡be ¡a ¡cipher ¡with ¡message ¡space ¡M. ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Def: ¡ ¡(E,D) ¡ ¡has ¡ciphertext ¡integrity ¡if ¡for ¡all ¡“efficient” ¡ ¡A: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡AdvCI[A,E] ¡ ¡= ¡ ¡Pr[Chal. ¡outputs ¡1] ¡ ¡ ¡ ¡is ¡“negligible.” ¡

  • Chal. ¡
  • Adv. ¡

k←K ¡ c ¡ m1 ¡∈ ¡M ¡ c1 ¡← ¡E(k,m1) ¡ b=1 ¡ ¡ ¡ ¡if ¡ ¡D(k,c) ¡≠⊥ ¡ ¡ ¡ ¡and ¡ ¡c ¡ ¡∉ ¡ ¡{ ¡c1 ¡, ¡… ¡, ¡cq ¡} ¡ b=0 ¡ ¡ ¡otherwise ¡

b ¡

m2 ¡ , ¡…, ¡mq ¡ c2 ¡ , ¡…, ¡cq ¡

slide-13
SLIDE 13

Dan ¡Boneh ¡

Authen,cated ¡encryp,on ¡

Def: ¡ ¡ ¡cipher ¡ ¡(E,D) ¡ ¡provides ¡authen'cated ¡encryp'on ¡(AE) ¡if ¡it ¡is ¡ ¡(1) ¡ ¡ ¡seman,cally ¡secure ¡under ¡CPA, ¡and ¡ ¡(2) ¡ ¡ ¡has ¡ciphertext ¡integrity ¡ ¡ ¡ Bad ¡example: ¡ ¡ ¡ ¡CBC ¡with ¡rand. ¡IV ¡does ¡not ¡provide ¡AE ¡

  • D(k,⋅) ¡never ¡outputs ¡ ¡⊥, ¡ ¡hence ¡adv. ¡easily ¡wins ¡CI ¡game ¡
slide-14
SLIDE 14

Dan ¡Boneh ¡

Implica,on ¡1: ¡ ¡ ¡authen,city ¡

A4acker ¡cannot ¡fool ¡Bob ¡into ¡thinking ¡a ¡ ¡ message ¡was ¡sent ¡from ¡Alice ¡ Alice ¡ Bob ¡ k ¡ k ¡ m1 ¡, ¡…, ¡ ¡mq ¡ ci ¡= ¡E(k, ¡mi) ¡ c ¡ Cannot ¡create ¡ ¡ valid ¡ ¡ ¡c ¡∉ ¡{ ¡c1, ¡…, ¡cq ¡} ¡

⇒ ¡ ¡if ¡ ¡D(k,c) ¡≠⊥ ¡Bob ¡knows ¡message ¡is ¡from ¡someone ¡who ¡knows ¡k ¡ ¡ ¡ ¡(but ¡message ¡could ¡be ¡a ¡replay) ¡ ¡

slide-15
SLIDE 15

Dan ¡Boneh ¡

Implica,on ¡2 ¡

¡ Authen,cated ¡encryp,on ¡ ¡ ¡ ¡⇒ ¡ ¡ ¡Security ¡against ¡chosen ¡ciphertext ¡aCacks ¡ ¡ ¡ ¡(next ¡segment) ¡

slide-16
SLIDE 16

Dan ¡Boneh ¡

End ¡of ¡Segment ¡

slide-17
SLIDE 17

Dan ¡Boneh ¡

Authen,cated ¡Encryp,on ¡

Chosen ¡ciphertext ¡ a4acks ¡

Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡

slide-18
SLIDE 18

Dan ¡Boneh ¡

Example ¡chosen ¡ciphertext ¡a4acks ¡

Adversary ¡has ¡ciphertext ¡ ¡c ¡ ¡that ¡it ¡wants ¡to ¡decrypt ¡

  • O]en, ¡adv. ¡can ¡fool ¡server ¡into ¡decryp,ng ¡certain ¡ciphertexts ¡ ¡(not ¡c) ¡

¡ ¡

  • O]en, ¡adversary ¡can ¡learn ¡par,al ¡informa,on ¡about ¡plaintext ¡

¡dest ¡= ¡25 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡data ¡ data ¡ ¡TCP/IP ¡packet ¡ ACK ¡ if ¡valid ¡ ¡ checksum ¡

slide-19
SLIDE 19

Dan ¡Boneh ¡

Chosen ¡ciphertext ¡security ¡

¡ Adversary’s ¡power: ¡ ¡ ¡ ¡both ¡CPA ¡and ¡CCA ¡

  • Can ¡obtain ¡the ¡encryp,on ¡of ¡arbitrary ¡messages ¡of ¡his ¡choice ¡
  • Can ¡decrypt ¡any ¡ciphertext ¡of ¡his ¡choice, ¡other ¡than ¡challenge ¡

¡ ¡(conserva,ve ¡modeling ¡of ¡real ¡life) ¡ ¡ Adversary’s ¡goal: ¡ ¡ ¡ ¡Break ¡sema,c ¡security ¡

slide-20
SLIDE 20

Dan ¡Boneh ¡

Chosen ¡ciphertext ¡security: ¡ ¡defini,on ¡

E = ¡(E,D) ¡ ¡cipher ¡defined ¡over ¡ ¡(K,M,C). For ¡ ¡ ¡b=0,1 ¡ ¡ ¡define ¡EXP(b): ¡ ¡

  • Chal. ¡

b ¡

  • Adv. ¡

k←K ¡

b’ ¡∈ ¡{0,1} ¡

mi,0 ¡, ¡mi,1 ¡ ¡∈ ¡M ¡: ¡ ¡ ¡ ¡|mi,0| ¡= ¡|mi,1| ¡ ci ¡← ¡E(k, ¡mi,b) ¡ for ¡i=1,…,q: ¡ ¡ ¡(1) ¡ ¡ ¡CPA ¡query: ¡ ¡ ¡ ¡ ¡(2) ¡ ¡ ¡CCA ¡query: ¡ ci ¡∈ ¡C ¡: ¡ ¡ ¡ ¡ ¡ci ¡∉ ¡{c1, ¡…, ¡ci-­‑1} ¡ mi ¡← ¡D(k, ¡ci) ¡

slide-21
SLIDE 21

Dan ¡Boneh ¡

Chosen ¡ciphertext ¡security: ¡defini,on ¡

E ¡is ¡CCA ¡secure ¡if ¡for ¡all ¡“efficient” ¡ ¡A: ¡ ¡ ¡ ¡ ¡ ¡AdvCCA ¡[A,E] ¡ ¡= ¡ ¡|Pr[EXP(0)=1] ¡– ¡Pr[EXP(1)=1] ¡| ¡ ¡is ¡“negligible.” ¡ Example: ¡ ¡ ¡ ¡CBC ¡with ¡rand. ¡IV ¡is ¡not ¡CCA-­‑secure ¡

  • Chal. ¡

b ¡

  • Adv. ¡

k←K ¡

m0 ¡, ¡m1 ¡ ¡ ¡: ¡ ¡ ¡ ¡ ¡ ¡ ¡|m0| ¡= ¡|m1|=1 ¡ c ¡← ¡E(k, ¡mb) ¡= ¡(IV, ¡c[0]) ¡ c’ ¡= ¡(IV⨁1, ¡c[0]) ¡ D(k, ¡c’) ¡= ¡mb⨁1 ¡

b ¡

slide-22
SLIDE 22

Dan ¡Boneh ¡

Authen,cated ¡enc. ¡⇒ ¡CCA ¡security ¡

Thm: ¡Let ¡(E,D) ¡be ¡a ¡cipher ¡that ¡provides ¡AE. ¡ ¡ ¡ ¡ ¡ ¡Then ¡(E,D) ¡is ¡CCA ¡secure ¡! ¡ ¡ ¡ ¡ ¡ ¡ ¡In ¡par,cular, ¡for ¡any ¡q-­‑query ¡eff. ¡A ¡there ¡exist ¡eff. ¡B1, ¡B2 ¡ ¡s.t. ¡ ¡AdvCCA[A,E] ¡≤ ¡2q⋅AdvCI[B1,E] ¡+ ¡AdvCPA[B2,E] ¡

slide-23
SLIDE 23

Dan ¡Boneh ¡

Proof ¡by ¡pictures ¡

  • Chal. ¡
  • Adv. ¡

k←K ¡

CPA ¡query: ¡ ¡mi,0 ¡, ¡mi,1 ¡ ¡ ¡ CCA ¡query: ¡ ¡ci ¡ ¡

ci=E(k,mi,0) ¡ D(k,ci) ¡

  • Chal. ¡
  • Adv. ¡

k←K ¡

CPA ¡query: ¡ ¡mi,0 ¡, ¡mi,1 ¡ ¡ ¡ CCA ¡query: ¡ ¡ci ¡ ¡

ci=E(k,mi,1) ¡ D(k,ci) ¡

CPA ¡query: ¡ ¡mi,0 ¡, ¡mi,1 ¡ ¡

  • Chal. ¡
  • Adv. ¡

k←K ¡ ci=E(k,mi,0) ¡

  • Chal. ¡
  • Adv. ¡

k←K ¡

CPA ¡query: ¡ ¡mi,0 ¡, ¡mi,1 ¡ ¡

ci=E(k,mi,1) ¡

⊥ ¡

CCA ¡query: ¡ ¡ci ¡ ¡

⊥ ¡

CCA ¡query: ¡ ¡ci ¡ ¡

≈p ¡ ≈p ¡ ≈p ¡ ≈p ¡

slide-24
SLIDE 24

Dan ¡Boneh ¡

So ¡what? ¡

Authen,cated ¡encryp,on: ¡

  • ensures ¡confiden,ality ¡against ¡an ¡ac,ve ¡adversary ¡ ¡ ¡ ¡

that ¡can ¡decrypt ¡some ¡ciphertexts ¡ ¡ Limita,ons: ¡ ¡ ¡ ¡ ¡

  • does ¡not ¡prevent ¡replay ¡a4acks ¡
  • does ¡not ¡account ¡for ¡side ¡channels ¡(,ming) ¡
slide-25
SLIDE 25

Dan ¡Boneh ¡

End ¡of ¡Segment ¡

slide-26
SLIDE 26

Dan ¡Boneh ¡

Authen,cated ¡Encryp,on ¡

Construc,ons ¡from ¡ ciphers ¡and ¡MACs ¡

Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡

slide-27
SLIDE 27

Dan ¡Boneh ¡

… ¡but ¡first, ¡ ¡some ¡history ¡

Authen,cated ¡Encryp,on ¡(AE): ¡ ¡ ¡ ¡ ¡introduced ¡in ¡2000 ¡ ¡ ¡ ¡[KY’00, ¡BN’00] ¡ ¡ Crypto ¡APIs ¡before ¡then: ¡ ¡ ¡ ¡ ¡(e.g. ¡ ¡ ¡MS-­‑CAPI) ¡

  • Provide ¡API ¡for ¡CPA-­‑secure ¡encryp,on ¡ ¡(e.g. ¡CBC ¡with ¡rand. ¡IV) ¡
  • Provide ¡API ¡for ¡MAC ¡ ¡(e.g. ¡HMAC) ¡

¡ Every ¡project ¡had ¡to ¡combine ¡the ¡two ¡itself ¡without ¡ ¡ a ¡well ¡defined ¡goal ¡

  • Not ¡all ¡combina,ons ¡provide ¡AE ¡… ¡
slide-28
SLIDE 28

Dan ¡Boneh ¡

Combining ¡MAC ¡and ¡ENC ¡ ¡ ¡(CCA) ¡

Encryption key kE. MAC key = kI Op,on ¡1: ¡ ¡ ¡(SSL) ¡ ¡ Op,on ¡2: ¡ ¡ ¡(IPsec) ¡ ¡ Op,on ¡3: ¡ ¡ ¡(SSH) ¡

msg m msg m

tag

E(kE ¡, ¡mlltag) ¡ S(kI, ¡m) ¡ msg m E(kE, ¡m) ¡

tag

S(kI, c) msg m E(kE ¡, ¡m) ¡

tag

S(kI, m)

always ¡ correct ¡

slide-29
SLIDE 29

Dan ¡Boneh ¡

A.E. ¡ ¡ ¡Theorems ¡

Let ¡ ¡ ¡(E,D) ¡ ¡ ¡be ¡CPA ¡secure ¡cipher ¡ ¡ ¡and ¡ ¡ ¡(S,V) ¡secure ¡MAC. ¡ ¡ ¡ ¡Then: ¡ ¡

  • 1. Encrypt-­‑then-­‑MAC: ¡ ¡ ¡always ¡provides ¡ ¡A.E. ¡
  • 2. MAC-­‑then-­‑encrypt: ¡ ¡ ¡may ¡be ¡insecure ¡against ¡CCA ¡a4acks ¡

¡however: ¡ ¡ ¡ ¡when ¡ ¡(E,D) ¡ ¡is ¡ ¡rand-­‑CTR ¡mode ¡or ¡rand-­‑CBC ¡ ¡ ¡ ¡M-­‑then-­‑E ¡ ¡provides ¡ ¡A.E. ¡ ¡ ¡for ¡rand-­‑CTR ¡mode, ¡one-­‑,me ¡MAC ¡is ¡sufficient ¡

slide-30
SLIDE 30

Dan ¡Boneh ¡

Standards ¡ ¡(at ¡a ¡high ¡level) ¡

  • GCM: ¡ ¡ ¡ ¡ ¡CTR ¡mode ¡encryp,on ¡ ¡then ¡ ¡ ¡CW-­‑MAC ¡

¡ ¡ ¡(accelerated ¡via ¡Intel’s ¡PCLMULQDQ ¡instruc,on) ¡

  • CCM: ¡ ¡ ¡ ¡ ¡CBC-­‑MAC ¡ ¡ ¡then ¡ ¡ ¡CTR ¡mode ¡encryp,on ¡ ¡(802.11i) ¡
  • EAX: ¡ ¡ ¡ ¡ ¡ ¡ ¡CTR ¡mode ¡encryp,on ¡ ¡then ¡ ¡CMAC ¡

All ¡support ¡AEAD: ¡ ¡(auth. ¡enc. ¡with ¡associated ¡data). ¡ ¡ ¡ ¡ ¡ ¡ ¡All ¡are ¡nonce-­‑based. ¡ ¡

encrypted data associated data authen,cated ¡ encrypted ¡

slide-31
SLIDE 31

Dan ¡Boneh ¡

An ¡example ¡API ¡ ¡(OpenSSL) ¡

int ¡AES_GCM_Init(AES_GCM_CTX ¡*ain, ¡ ¡unsigned ¡char ¡*nonce, ¡ ¡ ¡unsigned ¡long ¡noncelen, ¡ ¡unsigned ¡char ¡*key, ¡ ¡ ¡unsigned ¡int ¡klen ¡) ¡ ¡ int ¡AES_GCM_EncryptUpdate(AES_GCM_CTX ¡*a, ¡ ¡unsigned ¡char ¡*aad, ¡ ¡ ¡unsigned ¡long ¡aadlen, ¡ ¡unsigned ¡char ¡*data, ¡ ¡ ¡unsigned ¡long ¡datalen, ¡ ¡unsigned ¡char ¡*out, ¡ ¡ ¡unsigned ¡long ¡*outlen) ¡

slide-32
SLIDE 32

Dan ¡Boneh ¡

MAC ¡Security ¡ ¡-­‑-­‑ ¡ ¡an ¡explana,on ¡

Recall: ¡ ¡ ¡ ¡MAC ¡security ¡implies ¡ ¡ ¡ ¡ ¡ ¡ ¡(m ¡, ¡t) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡(m ¡, ¡t’ ¡) ¡ Why? ¡ ¡ ¡ ¡ ¡Suppose ¡not: ¡ ¡ ¡ ¡ ¡(m ¡, ¡t) ¡ ¡ ¡⟶ ¡ ¡ ¡(m ¡, ¡t’) ¡ Then ¡Encrypt-­‑then-­‑MAC ¡would ¡not ¡have ¡Ciphertext ¡Integrity ¡!! ¡

⇏ ¡

  • Chal. ¡

b ¡

  • Adv. ¡

k←K ¡

m0, ¡m1 ¡

c ¡← ¡E(k, ¡mb) ¡= ¡(c0, ¡t) ¡

c’ ¡= ¡(c0 ¡, ¡t’ ¡) ¡ ¡ ¡ ¡≠ ¡c ¡ D(k, ¡c’) ¡= ¡mb ¡

b ¡

(c0, ¡t) ¡ ¡ (c0, ¡t’) ¡ ¡

slide-33
SLIDE 33

Dan ¡Boneh ¡

OCB: ¡ ¡a ¡direct ¡construc,on ¡from ¡a ¡PRP ¡

More efficient authenticated encryption: one E() op. per block.

m[0] m[1] m[2] m[3]

⊕ ⊕ ⊕ ⊕

E(k,⋅) E(k,⋅) E(k,⋅) E(k,⋅) P(N,k,0) P(N,k,1) P(N,k,2) P(N,k,3)

⊕ ⊕ ⊕ ⊕

P(N,k,0) P(N,k,1) P(N,k,2) P(N,k,3) c[0] c[1] c[2] c[3] checksum E(k,⋅)

⊕ ⊕

c[4] P(N,k,0) auth

slide-34
SLIDE 34

Dan ¡Boneh ¡

Performance: ¡Crypto++ ¡ ¡5.6.0 ¡ ¡ ¡ ¡ ¡ ¡[ ¡Wei ¡Dai ¡] ¡

AMD ¡Opteron, ¡ ¡ ¡2.2 ¡GHz ¡ ¡ ¡ ¡ ¡( ¡Linux) ¡ ¡ ¡ ¡code ¡Speed ¡ ¡Cipher

¡ ¡size ¡(MB/sec) ¡ ¡AES/GCM ¡ ¡large ¡** ¡108 ¡ ¡AES/CTR ¡139 ¡ ¡AES/CCM ¡ ¡smaller ¡ ¡ ¡ ¡61 ¡AES/CBC ¡109 ¡ ¡AES/EAX ¡ ¡smaller ¡ ¡ ¡ ¡61 ¡ ¡ ¡ ¡ ¡ ¡AES/CMAC ¡109 ¡ ¡AES/OCB ¡ ¡ ¡ ¡129* ¡HMAC/SHA1 ¡147 ¡

* ¡extrapolated ¡from ¡Ted ¡Kravitz’s ¡results ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡** ¡non-­‑Intel ¡machines ¡

slide-35
SLIDE 35

Dan ¡Boneh ¡

End ¡of ¡Segment ¡

slide-36
SLIDE 36

Dan ¡Boneh ¡

Authen,cated ¡Encryp,on ¡

Case ¡study: ¡ ¡TLS ¡

Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡

slide-37
SLIDE 37

Dan ¡Boneh ¡

The ¡TLS ¡Record ¡Protocol ¡ ¡(TLS ¡1.2) ¡

Unidirec,onal ¡keys: ¡ ¡ ¡ ¡ ¡ ¡kb⇾s ¡ ¡ ¡and ¡ ¡ ¡ks⇾b ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Stateful ¡encryp,on: ¡

  • Each ¡side ¡maintains ¡two ¡64-­‑bit ¡counters: ¡ ¡ ¡ ¡ctrb⇾s ¡ ¡ ¡, ¡ ¡ctrs⇾b ¡
  • Init. ¡to ¡0 ¡when ¡session ¡started. ¡ ¡ ¡ ¡ ¡ctr++ ¡for ¡every ¡record. ¡
  • Purpose: ¡ ¡ ¡ ¡replay ¡defense ¡

kb⇾s ¡, ¡ks⇾b ¡ ¡

kb⇾s ¡, ¡ks⇾b ¡ ¡

TLS ¡record ¡ HDR ¡

slide-38
SLIDE 38

Dan ¡Boneh ¡

TLS ¡record: ¡ ¡encryp,on ¡ ¡ ¡(CBC ¡AES-­‑128, ¡ ¡ ¡HMAC-­‑SHA1) ¡

kb⇾s ¡= ¡(kmac ¡, ¡kenc) ¡ ¡ ¡ Browser ¡side ¡ ¡ ¡enc(kb⇾s ¡ ¡, ¡data, ¡ctrb⇾s ¡) ¡: ¡ ¡ ¡step ¡1: ¡ ¡ ¡ ¡ ¡tag ¡⟵ ¡ ¡S( ¡kmac ¡, ¡ ¡ ¡[ ¡ ¡++ctrb⇾s ¡ ¡ll ¡ ¡header ¡ ¡ll ¡ ¡data] ¡ ¡) ¡ ¡step ¡2: ¡ ¡ ¡ ¡ ¡pad ¡ ¡ ¡[ ¡header ¡ll ¡data ¡ll ¡tag ¡] ¡ ¡ ¡to ¡AES ¡block ¡size ¡ ¡step ¡3: ¡ ¡ ¡ ¡ ¡CBC ¡encrypt ¡with ¡kenc ¡and ¡new ¡random ¡IV ¡ ¡step ¡4: ¡ ¡ ¡ ¡ ¡prepend ¡header ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡data ¡

¡ type ¡ll ¡ver ¡ll ¡len ¡

tag ¡

pad ¡

slide-39
SLIDE 39

Dan ¡Boneh ¡

TLS ¡record: ¡ ¡decryp,on ¡(CBC ¡AES-­‑128, ¡ ¡ ¡HMAC-­‑SHA1) ¡

Server ¡side ¡ ¡ ¡dec(kb⇾s ¡ ¡, ¡record, ¡ctrb⇾s ¡) ¡: ¡ ¡ ¡step ¡1: ¡ ¡ ¡ ¡ ¡CBC ¡decrypt ¡record ¡using ¡kenc ¡ ¡ ¡step ¡2: ¡ ¡ ¡ ¡ ¡check ¡pad ¡format: ¡ ¡send ¡bad_record_mac ¡if ¡invalid ¡ ¡step ¡3: ¡ ¡ ¡ ¡ ¡check ¡tag ¡on ¡ ¡ ¡ ¡[ ¡++ctrb⇾s ¡ ¡ll ¡ ¡header ¡ ¡ll ¡ ¡data] ¡ ¡ ¡ ¡ ¡send ¡bad_record_mac ¡if ¡invalid ¡ ¡ Provides ¡authen,cated ¡encryp,on ¡ ¡(provided ¡no ¡other ¡info. ¡is ¡leaked ¡during ¡decryp,on) ¡

slide-40
SLIDE 40

Dan ¡Boneh ¡

Bugs ¡in ¡older ¡versions ¡ ¡(prior ¡to ¡TLS ¡1.1) ¡

IV ¡for ¡CBC ¡is ¡predictable: ¡ ¡ ¡ ¡ ¡(chained ¡IV) ¡ ¡IV ¡for ¡next ¡record ¡is ¡last ¡ciphertext ¡block ¡of ¡current ¡record. ¡ ¡Not ¡CPA ¡secure. ¡ ¡ ¡ ¡(a ¡prac,cal ¡exploit: ¡BEAST ¡a4ack) ¡ Padding ¡oracle: ¡ ¡ ¡ ¡ ¡during ¡decryp,on ¡ ¡if ¡pad ¡is ¡invalid ¡send ¡decryption failed alert ¡ if ¡mac ¡is ¡invalid ¡send ¡bad_record_mac alert ¡ ⇒ ¡ ¡ ¡a4acker ¡learns ¡info. ¡about ¡plaintext ¡ ¡ ¡(a4ack ¡in ¡next ¡segment) ¡ Lesson: ¡ ¡ ¡when ¡decryp,on ¡fails, ¡do ¡not ¡explain ¡why ¡

slide-41
SLIDE 41

Dan ¡Boneh ¡

Leaking ¡the ¡length ¡

The ¡TLS ¡header ¡leaks ¡the ¡length ¡of ¡TLS ¡records ¡

  • Lengths ¡can ¡also ¡be ¡inferred ¡by ¡observing ¡network ¡traffic ¡

For ¡many ¡web ¡applica,ons, ¡leaking ¡lengths ¡reveals ¡sensi,ve ¡info: ¡

  • In ¡tax ¡prepara,on ¡sites, ¡lengths ¡indicate ¡the ¡type ¡of ¡return ¡being ¡

filed ¡which ¡leaks ¡informa,on ¡about ¡the ¡user’s ¡income ¡

  • In ¡healthcare ¡sites, ¡lengths ¡leaks ¡what ¡page ¡the ¡user ¡is ¡viewing ¡
  • In ¡Google ¡maps, ¡lengths ¡leaks ¡the ¡loca,on ¡being ¡requested ¡

No ¡easy ¡solu,on ¡

slide-42
SLIDE 42

Dan ¡Boneh ¡

802.11b ¡WEP: ¡ ¡ ¡how ¡not ¡to ¡do ¡it ¡

802.11b ¡WEP: ¡ ¡ ¡ ¡ ¡ ¡ Previously ¡discussed ¡problems: ¡ ¡ ¡ ¡ ¡ ¡two ¡,me ¡pad ¡and ¡related ¡PRG ¡seeds ¡ k ¡ k ¡ m ¡

CRC(m) ¡ PRG( ¡ ¡IV ¡ ¡ll ¡ ¡k ¡) ¡ ¡

ciphetext ¡

IV ¡

slide-43
SLIDE 43

Dan ¡Boneh ¡

Ac,ve ¡a4acks ¡

Fact: ¡ ¡ ¡CRC ¡is ¡linear, ¡i.e. ¡ ¡ ¡ ¡∀m,p: ¡ ¡ ¡CRC( ¡m ¡⨁ ¡p) ¡= ¡CRC(m) ¡⨁ ¡F(p) ¡

¡ ¡dest-­‑port ¡= ¡80 ¡ ¡ ¡ ¡ ¡data ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡CRC ¡

IV ¡

WEP ¡ciphertext: ¡ a4acker: ¡

¡ ¡000…….00…..XX…0000… ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡F(XX) ¡ ⨁ ¡ IV ¡

¡ ¡dest-­‑port ¡= ¡25 ¡ ¡ ¡ ¡ ¡data ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡CRC’ ¡ XX ¡= ¡25⨁80 ¡

Upon ¡decryp,on: ¡ ¡ ¡ ¡CRC ¡is ¡valid, ¡ ¡ ¡but ¡ciphertext ¡is ¡changed ¡ ¡!! ¡

slide-44
SLIDE 44

Dan ¡Boneh ¡

End ¡of ¡Segment ¡

slide-45
SLIDE 45

Dan ¡Boneh ¡

Authen,cated ¡Encryp,on ¡

CBC ¡paddings ¡a4acks ¡

Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡

slide-46
SLIDE 46

Dan ¡Boneh ¡

Recap ¡

Authen'cated ¡encryp'on: ¡ ¡ ¡ ¡ ¡CPA ¡security ¡+ ¡ciphertext ¡integrity ¡

  • Confiden,ality ¡in ¡presence ¡of ¡ac've ¡adversary ¡
  • Prevents ¡chosen-­‑ciphertext ¡a4acks ¡

Limita,on: ¡ ¡cannot ¡help ¡bad ¡implementa,ons ¡… ¡ ¡ ¡(this ¡segment) ¡ ¡ Authen,cated ¡encryp,on ¡modes: ¡

  • Standards: ¡ ¡ ¡ ¡GCM, ¡ ¡CCM, ¡ ¡EAX ¡
  • General ¡construc,on: ¡ ¡ ¡ ¡encrypt-­‑then-­‑MAC ¡
slide-47
SLIDE 47

Dan ¡Boneh ¡

The ¡TLS ¡record ¡protocol ¡ ¡ ¡(CBC ¡encryp,on) ¡

Decryp,on: ¡ ¡ ¡ ¡dec(kb⇾s ¡ ¡, ¡record, ¡ctrb⇾s ¡) ¡: ¡ ¡ ¡step ¡1: ¡ ¡ ¡ ¡ ¡CBC ¡decrypt ¡record ¡using ¡kenc ¡ ¡ ¡step ¡2: ¡ ¡ ¡ ¡ ¡check ¡pad ¡format: ¡ ¡abort ¡if ¡invalid ¡ ¡step ¡3: ¡ ¡ ¡ ¡ ¡check ¡tag ¡on ¡ ¡ ¡ ¡[ ¡++ctrb⇾s ¡ ¡ll ¡ ¡header ¡ ¡ll ¡ ¡data] ¡ ¡ ¡ ¡ ¡abort ¡if ¡invalid ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡data ¡

¡ type ¡ll ¡ver ¡ll ¡len ¡

tag ¡

pad ¡

Two ¡types ¡of ¡error: ¡

  • padding ¡error ¡
  • MAC ¡error ¡
slide-48
SLIDE 48

Dan ¡Boneh ¡

Padding ¡oracle ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡data ¡

¡ type ¡ll ¡ver ¡ll ¡len ¡

tag ¡

pad ¡

Suppose ¡a4acker ¡can ¡differen,ate ¡the ¡two ¡errors ¡ ¡ ¡ ¡ ¡ ¡ ¡(pad ¡error, ¡MAC ¡error): ¡ ⇒ ¡ ¡ ¡ ¡Padding ¡oracle: ¡ ¡ ¡ ¡ ¡ ¡ ¡a4acker ¡submits ¡ciphertext ¡and ¡learns ¡if ¡ ¡ ¡ ¡last ¡bytes ¡of ¡plaintext ¡are ¡a ¡valid ¡pad ¡ Nice ¡example ¡of ¡a ¡ ¡ chosen ¡ciphertext ¡aCack ¡

slide-49
SLIDE 49

Dan ¡Boneh ¡

Padding ¡oracle ¡via ¡,ming ¡OpenSSL ¡

Credit: ¡ ¡Brice ¡Canvel ¡ (fixed ¡in ¡OpenSSL ¡0.9.7a) ¡

In ¡older ¡TLS ¡1.0: ¡ ¡ ¡padding ¡oracle ¡due ¡to ¡different ¡alert ¡messages. ¡

slide-50
SLIDE 50

Dan ¡Boneh ¡

Using ¡a ¡padding ¡oracle ¡ ¡ ¡(CBC ¡encryp,on) ¡

D(k,⋅) ¡ D(k,⋅) ¡

m[0] ¡ m[1] ¡ ¡ ¡m[2] ¡ ¡ ¡ll ¡ ¡ ¡pad ¡

⊕ ¡ ⊕ ¡

D(k,⋅) ¡

⊕ ¡

c[0] ¡ c[1] ¡ c[2] ¡ IV ¡

A4acker ¡has ¡ciphertext ¡ ¡c ¡= ¡(c[0], ¡c[1], ¡c[2]) ¡ ¡ ¡and ¡it ¡wants ¡ ¡m[1] ¡

slide-51
SLIDE 51

Dan ¡Boneh ¡

Using ¡a ¡padding ¡oracle ¡ ¡ ¡(CBC ¡encryp,on) ¡

D(k,⋅) ¡ D(k,⋅) ¡

m[0] ¡ m[1] ¡

⊕ ¡ ⊕ ¡

c[0] ¡ c[1] ¡ IV ¡

step ¡1: ¡ ¡ ¡ ¡let ¡ ¡g ¡ ¡be ¡a ¡guess ¡for ¡the ¡last ¡byte ¡of ¡ ¡ ¡m[1] ¡ ¡ ⨁ ¡g ¡⨁ ¡0x01 ¡ = ¡last-­‑byte ¡⨁ ¡g ¡⨁ ¡0x01 ¡ ¡ if ¡last-­‑byte ¡= ¡g: ¡ ¡ ¡valid ¡pad ¡ ¡ ¡ ¡ ¡otherwise: ¡ ¡ ¡ ¡ ¡ ¡invalid ¡pad ¡

slide-52
SLIDE 52

Dan ¡Boneh ¡

Using ¡a ¡padding ¡oracle ¡ ¡ ¡(CBC ¡encryp,on) ¡

A4ack: ¡ ¡ ¡submit ¡ ¡ ¡ ¡( ¡IV, ¡c’[0], ¡ ¡c[1] ¡) ¡ ¡to ¡padding ¡oracle ¡ ¡ ¡ ¡⇒ ¡ ¡ ¡a4acker ¡learns ¡if ¡ ¡last-­‑byte ¡= ¡g ¡ ¡ Repeat ¡ ¡with ¡ ¡ ¡g ¡= ¡0,1, ¡…, ¡255 ¡ ¡to ¡learn ¡last ¡byte ¡of ¡m[1] ¡ ¡ Then ¡use ¡a ¡ ¡(02, ¡02) ¡ ¡pad ¡to ¡learn ¡the ¡next ¡byte ¡and ¡so ¡on ¡… ¡

slide-53
SLIDE 53

Dan ¡Boneh ¡

IMAP ¡over ¡TLS ¡

Problem: ¡ ¡ ¡TLS ¡renego,ates ¡key ¡when ¡an ¡invalid ¡record ¡is ¡received ¡ ¡ ¡ Enter ¡IMAP ¡over ¡TLS: ¡ ¡ ¡ ¡ ¡(protocol ¡for ¡reading ¡email) ¡

  • Every ¡five ¡minutes ¡client ¡sends ¡login ¡message ¡to ¡server: ¡

¡LOGIN ¡"username” ¡"password” ¡

  • Exact ¡same ¡a4ack ¡works, ¡despite ¡new ¡keys ¡

¡⇒ ¡ ¡ ¡recovers ¡password ¡in ¡a ¡few ¡hours. ¡

slide-54
SLIDE 54

Dan ¡Boneh ¡

Lesson ¡

¡

  • 1. ¡ ¡Encrypt-­‑then-­‑MAC ¡would ¡completely ¡avoid ¡this ¡problem: ¡

¡ ¡MAC ¡is ¡checked ¡first ¡and ¡ciphertext ¡discarded ¡if ¡invalid ¡ ¡ ¡

  • 2. ¡ ¡MAC-­‑then-­‑CBC ¡provides ¡A.E., ¡but ¡padding ¡oracle ¡destroys ¡it ¡
slide-55
SLIDE 55

Will ¡this ¡a4ack ¡work ¡if ¡TLS ¡used ¡counter ¡mode ¡instead ¡of ¡CBC? ¡ ¡(i.e. ¡ ¡use ¡ ¡MAC-­‑then-­‑CTR ¡) ¡ Yes, ¡padding ¡oracles ¡affect ¡all ¡encryp,on ¡schemes ¡ It ¡depends ¡on ¡what ¡block ¡cipher ¡is ¡used ¡ No, ¡counter ¡mode ¡need ¡not ¡use ¡padding ¡

slide-56
SLIDE 56

Dan ¡Boneh ¡

End ¡of ¡Segment ¡

slide-57
SLIDE 57

Authen,cated ¡Encryp,on ¡

A4acking ¡non-­‑atomic ¡ decryp,on ¡

Online ¡Cryptography ¡Course ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dan ¡Boneh ¡

slide-58
SLIDE 58

Dan ¡Boneh ¡

SSH ¡Binary ¡Packet ¡Protocol ¡

Decryp,on: ¡

  • step ¡1: ¡ ¡decrypt ¡packet ¡length ¡field ¡only ¡(!) ¡
  • step ¡2: ¡ ¡read ¡as ¡many ¡packets ¡as ¡length ¡specifies ¡
  • step ¡3: ¡ ¡decrypt ¡remaining ¡ciphertext ¡blocks ¡
  • step ¡4: ¡ ¡check ¡MAC ¡tag ¡and ¡send ¡error ¡response ¡if ¡invalid ¡ ¡
  • seq. ¡
  • num. ¡

packet ¡

  • len. ¡

pad ¡

  • len. ¡

payload ¡ pad ¡ MAC ¡ tag ¡

CBC ¡encryp,on ¡ ¡ ¡(chained ¡IV) ¡

MAC ¡computed ¡ ¡

  • ver ¡plaintext ¡
slide-59
SLIDE 59

Dan ¡Boneh ¡

An ¡a4ack ¡on ¡the ¡enc. ¡length ¡field ¡ ¡(simplified) ¡

A4acker ¡has ¡one ¡ciphertext ¡block ¡ ¡c ¡= ¡AES(k, ¡m) ¡ ¡ ¡and ¡it ¡wants ¡ ¡m ¡ k ¡

  • seq. ¡
  • num. ¡

c ¡

  • ne ¡AES ¡block ¡

decrypt ¡ and ¡obtain ¡ “len” ¡field ¡

len ¡ send ¡bytes ¡one ¡at ¡a ¡,me ¡ when ¡“len” ¡bytes ¡read: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡server ¡sends ¡“MAC ¡error” ¡

a4acker ¡learns ¡32 ¡LSB ¡bits ¡of ¡m ¡ ¡!! ¡

slide-60
SLIDE 60

Lesson ¡

The ¡problem: ¡ ¡ ¡(1) ¡non-­‑atomic ¡decrypt ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡(2) ¡len ¡field ¡decrypted ¡and ¡used ¡before ¡it ¡is ¡authen,cated ¡ How ¡would ¡you ¡redesign ¡SSH ¡to ¡resist ¡this ¡a4ack? ¡ Send ¡the ¡length ¡field ¡unencrypted ¡(but ¡MAC-­‑ed) ¡ ¡ ¡ Replace ¡encrypt-­‑and-­‑MAC ¡by ¡encrypt-­‑then-­‑MAC ¡ Add ¡a ¡MAC ¡of ¡(seq-­‑num, ¡length) ¡right ¡a]er ¡the ¡len ¡field ¡ Remove ¡the ¡length ¡field ¡and ¡iden,fy ¡packet ¡boundary ¡ by ¡verifying ¡the ¡MAC ¡a]er ¡every ¡received ¡byte ¡

slide-61
SLIDE 61

Dan ¡Boneh ¡

Further ¡reading ¡

  • The ¡Order ¡of ¡Encryp,on ¡and ¡Authen,ca,on ¡for ¡Protec,ng ¡

Communica,ons, ¡H. ¡Krawczyk, ¡Crypto ¡2001. ¡

  • Authen,cated-­‑Encryp,on ¡with ¡Associated-­‑Data, ¡ ¡
  • P. ¡Rogaway, ¡Proc. ¡of ¡CCS ¡2002. ¡
  • Password ¡Intercep,on ¡in ¡a ¡SSL/TLS ¡Channel, ¡ ¡
  • B. ¡Canvel, ¡A. ¡Hiltgen, ¡S. ¡Vaudenay, ¡M. ¡Vuagnoux, ¡Crypto ¡2003. ¡
  • ¡Plaintext ¡Recovery ¡A4acks ¡Against ¡SSH, ¡ ¡
  • M. ¡Albrecht, ¡K. ¡Paterson ¡and ¡G. ¡Watson, ¡IEEE ¡S&P ¡2009 ¡
  • Problem ¡areas ¡for ¡the ¡IP ¡security ¡protocols, ¡
  • S. ¡Bellovin, ¡Usenix ¡Security ¡1996. ¡
slide-62
SLIDE 62

Dan ¡Boneh ¡

End ¡of ¡Segment ¡