• No results found

Authenticated encryption

N/A
N/A
Protected

Academic year: 2021

Share "Authenticated encryption"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

Authenticated encryption

Dr. Enigma

Department of Electrical Engineering & Computer Science University of Central Florida

[email protected]

October 16th, 2013

(2)

Active attacks on CPA-secure

encryption

(3)

Summary

I confidentiality

encryption secure againsteavesdropping only

I integrity

MAC secure againstforging of messages

I this module

encryption secure against tampering

encrypt provides both confidentiality and integrity

(4)

Sample tampering attacks

TCP/IP:

source

machine TCP/IP

stack

Eve port=25 WWW port=80

dest=80 | data

data

(5)

Sample tampering attacks

TCP/IP:

key k

TCP/IP stack

key k

Eve port=25 WWW port=80

dest=80 | data dest=25 | stuff

data

stuff

(6)

Reading someone else’s data

IV dest=80 | data decrypts to

−−−−−−−−−−−−→ dest=80 | data goal: attacker seeks to change IV to IV’ such that

IV’ dest=80 | data decrypts to

−−−−−−−−−−−−→ dest=25 | data

key k

TCP/IP stack

key k

Eve port=25 WWW port=80 IV’ dest=80 | data

data

such modification is easy to do for CBC with random IV

(7)

Modification

encryption is done with CBC with a random IV IV dest=80 | data decrypts to

−−−−−−−−−−−−→ dest=80 | data how should the attacker choose IV’ so that:

IV’ dest=80 | data decrypts to

−−−−−−−−−−−−→ dest=25 | data

(8)

An attack using only network access

remote terminal application: each key stroke encrypted with CTR mode

IP hdr | TCP hdr | T | D T: 16 bit TCP checksum D: 1 byte keystroke for all t, s, attacker sends

IP hdr | TCP hdr | ⊕t | ⊕s

and receives ACK if valid checksum and nothing otherwise checksum(hdr,D)=t⊕checksum(hdr,D ⊕ s) ⇒ can find D

(9)

The lesson

I CPA security cannot guarantee secrecy under active attacks

I use only one of the two modes

I message integrity required, but confidentiality not necessary ⇒ use a message authentication code (MAC)

I both integrity and confidentiality required ⇒ use authenticated encryption modes

(10)

Definitions

(11)

Definition of authenticated encryption

I an authenticated encryption system (E , D) is a cipher where as usual: E : K × M → C

new: D : K × M → C ∪ {⊥}

⊥ means that ciphertext is rejected

I security requirements: the system must ensure

I semantic security under a CPA attack

I ciphertext integrity

attacker cannot create new ciphertexts that decrypt properly

(12)

Cipher integrity

I let (E , D) be a cipher with message space M m0, . . . , mq−1∈ M

Chal ←−−−−−−−−−−−−−−−−−−−−−−−−−−−− Adv c0= E (k, m0), . . . , cq−1 = E (k, mq−1) k ← K −−−−−−−−−−−−−−−−−−−−−−−−−−−−→

c

←−−−−−−−−−−−−−−−−−−−−−−−−−−−−

b

b = 1 if D(k, c) 6=⊥ ∧c 6∈ {c0, . . . , cq−1} b = 0 otherwise

I definition: (E , D) has ciphertext integrityif for all efficient A:

AdvCI(A, E ) = Pr(b = 1) is negligible

(13)

Authenticated encryption

I definition: a cipher (E , D) provides authenticated encryption (AE) if it is

1. semantically secure under CPA 2. has ciphertext integrity

I bad example: CBC with random IV does not provide AE D(k, ·) never outputs ⊥ and so adversary always wins CI game

(14)

Implication 1: authenticity

attacker cannot fool Bob into thinking message was sent from Alice

Alice

m0, . . . , mq−1

←−−−−−−−−−−−−−−

c0, . . . , cq−1

−−−−−−−−−−−−−−→

−−−−−−−−−−−−−−→ Bob

attacker cannot create valid c 6∈ {c0, . . . , cq−1}

if D(k, c) 6=⊥ Bob knows message must be from someone who knows k

but message could be a replay

(15)

Implication 2

authenticated encryption ⇒ security against chosen ciphertext attacks

(16)

Chosen ciphertext attacks

(17)

Examples of chosen ciphertext attacks

I often, adversary can fool server into decrypting certain ciphertexts

dest = 25 | data data

I often, adversary can learn partial information about plaintext

TCP/IP packet ACK

if valid checksum

(18)

Chosen ciphertext security

adversary’s power: both CPA and CCA

I can obtain the encryption of arbitrary messages of his choice

I can decrypt any ciphertext of his choice that is not equal to the challenge

conservative modeling of real-life situation adversary’s goal: break semantic security

(19)

Definition of ciphertext security

let (E , D) be a cipher defined over (K, M, K)

challenger k ← K

for i = 0, . . . , q (1) CPA query m0,i, m1,i ∈ M

←−−−−−−−−−−−−−−−−−−

−−−−−−−−−−−−−−−−−−→

ci = E (k, mb,i) (2) CCA query ci ∈ C \ {c0, . . . , ci −1}

←−−−−−−−−−−−−−−−−−−

−−−−−−−−−−−−−−−−−−→

mi = D(k, ci)

adversary

(20)

Definition of chosen ciphertext security

I (E , D) is CCA-secure if for all efficient A AdvCCA(A, E ) is negligible

I CBC with random IV is not CCA-secure

1. adversary submits the messages m0 and m1to challenger for encryption and obtains

c = E (k, mb) = (IV , c0) where b is unknown 2. adversary submits the ciphertext c0= (IV ⊕ 1, c0) to

challenger for decryption and obtains D(k, c0) = mb⊕ 1

(21)

Authenticated encryption ⇒ CCA security

I Theorem:

let (E , D) be a cipher that provides AE ⇒ (E , D) is CCA-secure

in particular, for any q-query efficient algorithm, there exist B1 and B2 such that

AdvCCA(A, E )

2q · AdvCI(B1, E ) + AdvCPA(B2, E )AdvCCA(A, E )

(22)

Why is this important?

authenticated encryption:

I ensure confidentiality against active attackers that can decrypt some ciphertexts

limitations of AE:

I does not prevent replay attacks

I does not account for side channels such as timing

(23)

Construction from ciphers and

MACs

(24)

Combining MAC and ENC

encryption key kE, MAC key kI 1. (SSL)

m mkt = mkS (kI, m) E (kE, mkt)

2. (IPSec)

m c = E (kE, m) ckt = ckS (kI, c)

3. (SSH)

m c = E (kE, m) ckt = ckS (kI, m)

(25)

Authenticated encryption theorems

let (E , D) be a CPA secure cipher and (S , V ) a secure MAC ⇒ 1. encrypt-then-MAC: always provides AE

2. MAC-then-encrypt: may be insecure against CCA attacks however: (E , D) is rand-CTR mode or rand-CBC mode ⇒ M-then-E provides AE

for rand-CTR mode, one-time MAC is sufficient

(26)

Explanation of MAC security

recall: MAC security requires that (m, t) 6⇒ (m, t0) why is this important?

suppose that (m, t) 6⇒ (m, t0) ⇒

encrypt-then-MAC would not have ciphertext integrity 1. attacker submits m0, m1 for encryption and receives

c = E (k, mb) = (c0, t) where b is unknown to attacker

2. attacker computes alternative tag t0, submits c0 = (c0, t0) for decryption, and obtains

D(k, c0) = mb

(27)

OCB: a direct construction from a PRP

more efficient authenticated encryption scheme:

I only one encryption per block

I parallelizable

m0 m1 m2 m3 checksum

P(n, k, 0) P(n, k, 1) P(n, k, 2) P(n, k, 3) P(n, k, 4)

E (k, ·) E (k, ·) E (k, ·) E (k, ·) E (k, ·)

P(n, k, 0) P(n, k, 1) P(n, k, 2) P(n, k, 3) auth

c0 c1 c2 c3 c4

(28)

Standards

I GCM: CTR mode encryption then CW-MAC

I CCM: CBC-MAC then CTR encryption (802.11i)

I EAX: CTR mode encryption then CMAC

References

Related documents

Box plots of gestational age at delivery (weeks) and birth weight discordance (%) in monochorionic diamniotic (MCDA) twins without twin anemia polycythemia sequence (TAPS) and

M- MDSC isolated from ZA-treated tumors significantly downregulated also immunesupre sive markers Arg-I and NOS2 (-18 fold change). This data show that monocytic myeloid cell CM-

This study aimed to investigate the use of Internet for searching information on medicines and diseases, establishing the following objectives and collecting information about:

It suggests that the conceptual significance of explanations in scientific practice is not exhausted by the knowledge that they convey or the psychological abilities

In Kenya, the Central Bank of Kenya has played a pivotal role in enhancing penetration of the agency banking model.. In 2009 for instance, the CBK commenced measures to open

candidates or of the program, two critical requirements of the state administrative code. The most serious concern noted by the team was the lack of responsibility on the part of

The cosmopolitan characteristics of the neighbourhood and schools, made up as they were of different and conflicting ethnic groups (in contrast to the first-generational AKs

KRR holds the philosophy and practice a corporate culture to ensure their guests to always enjoy the best in term of food variety and quality, restaurant ambience, menu price