Authenticated Encryption: Kenny Paterson Information Security Group @kennyog WWW - Isg.rhul - Ac.uk/ KP
Authenticated Encryption: Kenny Paterson Information Security Group @kennyog WWW - Isg.rhul - Ac.uk/ KP
Authenticated Encryption: Kenny Paterson Information Security Group @kennyog WWW - Isg.rhul - Ac.uk/ KP
Encryption
Kenny Paterson
Information Security Group
@kennyog ; www.isg.rhul.ac.uk/~kp
Motivation for Authenticated Encryption
Authenticated Encryption (AE)
m1
m2
Security goals:
Confidentiality and integrity of messages exchanged between Alice and Bob.
Adversarial capabilities:
Adversary can arbitrarily delete, reorder, modify, etc, bits on the wire.
Adversary can mount chosen plaintext and chosen ciphertexts attacks – formalised via
encryption and decryption oracles.
Tools we have:
Encryption (e.g. block cipher in CBC mode, CTR mode, stream cipher) and MAC algorithms
(e.g. HMAC, CBC-MAC).
3
Formalising Symmetric Encryption
5
IND-CPA security
• The adversary has repeated access to Left-or-Right (LoR) encryption
oracle.
• In each query, the adversary submits pairs of equal length plaintexts
(m0,m1) to the oracle.
• We can have m0 = m1, so we get an encryption oracle “for free”.
• The adversary gets back c, an encryption of mb, where b is a fixed but
random bit.
• After all queries are made, the adversary outputs its estimate b’ for bit b.
• The adversary wins if it decides correctly.
IND = Indistinguishable
CPA = Chosen Plaintext Attack
6
IND-CPA security in a picture
Adversary Challenger
b ← {0,1}
K ← KGen
(m0,m1)
c = EncK(mb)
c
9
Motivating stronger security
10
INT-CTXT security in a picture
Adversary Challenger
K ← KGen
m
c = EncK(m)
c
Try(c*)
m* = DecK(c*)
Adversary wins if c* is
“new” and m* ≠ ┴
11
Integrity of Ciphertexts – INT-CTXT
13
INT-PTXT security in a picture
Adversary Challenger
K ← KGen
m
c = EncK(m)
c
Try(c*)
m* = DecK(c*)
Adversary wins if m* is
“new” and m* ≠ ┴
14
INT-PTXT security
15
Definitions for AE Security
AE Security
17
What about chosen ciphertext attacks?
18
IND-CCA security in a picture
Adversary Challenger
b ← {0,1}
K ← KGen
(m0,m1)
c*
c* = EncK(mb)
c
┴/m ┴/m = DecK(c)
20
Relations between security notions
AE:
IND-CPA+
INT-CTXT
IND-CPA
IND-CCA
+ INT-PTXT
IND-CPA INT-PTXT
21
AE security and beyond
22
Generic composition
Generic composition for AE
Encrypt-and-MAC (E&M)
• compute c’ ← EncKE(m) and τ ← TagKM (m) and output c = (c’,τ).
• used in SSH
MAC-then-Encrypt (MtE)
• compute τ ← TagKM(m) and output c = EncKE (m || τ).
• used in TLS
Encrypt-then-MAC (EtM)
• compute c’ ← EncKE (m) and τ ← TagKM (c’) and output c = (c’,τ).
• used in IPsec ESP “enc + auth”
25
Security of generic composition for AE
26
Security of generic composition for AE
27
Security of generic composition for AE
If the errors at steps 2 and 3 are distinguishable, then we can carry out a
padding oracle attack!
• Padding error -> padding bad.
• MAC verification error -> padding good!
This attack is a special case of a chosen-ciphertext attack, which should be
prevented by AE security (recall AE security implies IND-CCA security).
29
Security of MtE generic composition for AE
30
AEAD
Authenticated Encryption with Associated Data (AEAD)
Encryption scope
32 MAC scope
Authenticated Encryption with Associated Data (AEAD)
36
Security for nonce-based AEAD
38
Using nonce-based AEAD
c0
c1
c2
• Many other AEAD schemes are available; we will look at just two, CCM and GCM.
41
CCM
CTR mode
encryption
CBC MAC
42
CCM
CTR mode
encryption
N || 1031
Encryption
mask for
universal
hash
AD
46
Going Still Further
AEAD ≠ secure channel
• It doesn’t…
48
AEAD ≠ secure channel
m1 Ch
Enc(.,.,.)
+ m2
Dec(.,.,.)
Ch
c= Enc(Set-Cookie: SID=[AuthenticationToken]; secure)
Set-Cookie: SID=[AuthenticationToken]
50
Cookie cutters
Ch Set-Cookie:
Set-Cookie: Set- SID=[AuthToken];
SID=[AuthToken] Cookie: secure
SID = …
2 TLS records
53
Cookie cutters
Ch Set-Cookie:
Set-Cookie: Set- SID=[AuthToken];
SID=[AuthToken] Cookie: secure
SID = …
54
From AEAD to secure channels
From AEAD to secure channels
56
Streaming secure channels (FGMP15)
60