Presentation is loading. Please wait.

Presentation is loading. Please wait.

Authenticated encryption

Similar presentations


Presentation on theme: "Authenticated encryption"β€” Presentation transcript:

1 Authenticated encryption

2

3 Mac forgery game M ←{} k ∈ 𝑅 0,1 𝑠 π‘šβ€² M←𝑀βˆͺ{π‘šβ€²} Repeat as many times
as the adversary wants 𝑑′ β†π‘šπ‘Ž 𝑐 π‘˜ (π‘šβ€²) 𝑑′ Wins if π‘š βˆ‰π‘€ π‘£π‘’π‘Ÿπ‘–π‘“π‘¦ π‘š,𝑑 =1 (π‘š,𝑑)

4 Mac forgery game Allow the adversary to learn tags for as many message as he wants A mac scheme is secure if Pr π‘Žπ‘‘π‘£ 𝑀𝑖𝑛𝑠 π‘‘β„Žπ‘’ π‘“π‘œπ‘Ÿπ‘”π‘’π‘Ÿπ‘¦ π‘”π‘Žπ‘šπ‘’ ≀𝑛𝑒𝑔𝑙(𝑠)

5 Does authentication imply secrecy
Consider the question from the quiz The answer is yes. To prove this is the case, we will take an adversary which forges a mac for this scheme and breaks the original mac scheme

6 Does authentication imply secrecy
Consider the question from the quiz More formally, if the scheme is insecure => βˆƒ 𝐴∈ 𝑃𝑃𝑇 which produces 𝑑=(𝑑’,π‘šβ€™) such that π‘‰π‘’π‘Ÿπ‘–π‘“π‘¦(π‘˜,π‘š,(𝑑’,π‘šβ€™)) = π‘Žπ‘π‘π‘‘π‘’π‘π‘‘ for a fresh m’ However since π‘‰π‘’π‘Ÿπ‘–π‘“π‘¦β€™ (π‘˜,π‘š,(𝑑’,π‘šβ€™)) = π‘‰π‘’π‘Ÿπ‘–π‘“π‘¦(π‘˜,π‘š,𝑑’), this means that the adversary created a mac tag for the original scheme. Hence, the original scheme is not a mac scheme. By contradiction, we have a mac scheme.

7 Lesson Lesson Authentication ⇏ Encryption Encryption ⇏ Authentication In the future, if I ever see anyone mention ciphertext in a question that only talks about macs, there will be a loss of points.

8 Validation-oracle indistinguishability game
Validation-oracle games Adversary chooses π‘š 0 , π‘š 1 In 𝐺 0 , the game returns 𝐸𝑛𝑐 π‘š 0 In 𝐺 1 , the game returns 𝐸𝑛𝑐( π‘š 1 ) In both 𝐺 0 and 𝐺 1 , the adversary can send extra ciphertexts and the oracle tells the adversary if the decryption of the ciphertext falls into the message space The adversary has to guess which game he is playing

9 Validation-oracle indistinguishability game
π‘š 0 , π‘š 1 π‘š 0 , π‘š 1 c c←𝐸𝑛𝑐( π‘š 0 ) c c←𝐸𝑛𝑐( π‘š 1 ) 𝑐′ 𝑐 β€² 𝑣←𝐷𝑒𝑐 𝑐′ βˆˆπ‘€ 𝑣←𝐷𝑒𝑐 𝑐′ βˆˆπ‘€ v 𝑣 Repeat as many times as the distinguisher wants Repeat as many times as the distinguisher wants 𝐺 0 𝐺 1

10 Pseudo-random function
A class of functions ( 𝐹 1 ,…, 𝐹 2 𝑛 ) is pseudo-random if the following two games are indistinguishable F β†π‘Ÿπ‘Žπ‘›π‘‘π‘œπ‘š π‘“π‘’π‘›π‘π‘‘π‘–π‘œπ‘› k ∈ 𝑅 0,1 𝑛 F ← 𝐹 𝐾 m m w←𝐹(π‘š) 𝑀←𝐹(π‘š) 𝑀 𝑀 Repeat as many times as the distinguisher wants Repeat as many times as the distinguisher wants 𝐺 0 𝐺 1

11 CPA-secure encryption scheme from PRF
𝐾𝑒𝑦𝑔𝑒𝑛 {1} 𝑠 π‘˜ ∈ 𝑅 0,1 𝑠 𝐸𝑛 𝑐 π‘˜ π‘š π‘Ÿ ∈ 𝑅 0,1 𝑛 𝑐← π‘Ÿ, 𝐹 π‘˜ π‘Ÿ βŠ•π‘š 𝐷𝑒 𝑐 π‘˜ 𝑐 π‘Ÿ,𝑑 ←𝑐 π‘šβ† 𝐹 π‘˜ π‘Ÿ βŠ•π‘‘ Important property 𝐷𝑒𝑐 𝐸𝑛𝑐 π‘š βŠ• πœ– =π‘š+πœ–

12 Breaking security of the scheme using validation oracle
Let the message space be M = {1100,0110,0101} Important property: Let r,v =𝐸𝑛𝑐(π‘š) then 𝐷𝑒𝑐 π‘Ÿ,π‘£βŠ•πœ– =π‘šβŠ•πœ– Given validation oracle Consider what happens if we decrypt (π‘Ÿ,π‘£βŠ•π‘Ÿ,π‘£βŠ•πœ–)βŠ• 0,π‘₯ with πœ–=0011 β†’1111βˆ‰π‘€ 0110, β†’0110, 0110βˆˆπ‘€

13 Why do we care about the validation oracle
When people encrypt messages and send it to servers, it is typical that if the decrypted message does not have the right format it returns an error Original PKCS paper (detailing how to use Crypto in the real world) had an attack where the attacker can modify the ciphertext and learn one bit depending on if an error received a message

14 General format of a validation attack
Take the message space M Generate a modification of the ciphertext which maps certain encrypted messages back to the ciphertext and others not Especially useful if the encryption scheme is homomorphic: (𝐸𝑛𝑐,𝐷𝑒𝑐) is homomorphic if there exists βŠ™,βŠ— such that 𝐸𝑛𝑐 π‘š 1 βŠ™ π‘š 2 = 𝐸𝑛𝑐 π‘š 1 βŠ— 𝐸𝑛𝑐( π‘š 2 )

15 Some homomorphic encryption scheme
Especially useful if the encryption scheme is homomorphic: (𝐸𝑛𝑐,𝐷𝑒𝑐) is homomorphic if there exists βŠ™,βŠ— such that 𝐸𝑛𝑐 π‘š 1 βŠ™ π‘š 2 = 𝐸𝑛𝑐 π‘š 1 βŠ— 𝐸𝑛𝑐( π‘š 2 ) One-time pad βŠ™ β‰”βŠ• βŠ— ≔ βŠ• RSA, El-gammal βŠ™ ≔+ βŠ—β‰” Γ—

16 Authenticated encryption
Authenticated (adversary cannot forge a ciphertext) Encrypted (adversary cannot learn message)

17 Chosen-ciphertext game
Distinguisher loses automatically if 𝑐 = 𝑐′ π‘š 0 , π‘š 1 π‘š 0 , π‘š 1 c c←𝐸𝑛𝑐( π‘š 0 ) c c←𝐸𝑛𝑐( π‘š 1 ) 𝑐′ 𝑐 β€² m m←𝐷𝑒𝑐(𝑐′) π‘š m←𝐸𝑛𝑐(𝑐′) Repeat as many times as the distinguisher wants Repeat as many times as the distinguisher wants 𝐺 0 𝐺 1

18 Unforgeability game M ←{} k ∈ 𝑅 0,1 𝑠 π‘šβ€² M←𝑀βˆͺ{π‘šβ€²} 𝑐′ ←𝐸𝑛𝑐(π‘šβ€²) cβ€²
𝑐′ ←𝐸𝑛𝑐(π‘šβ€²) cβ€² Wins if Dec(c) β‰  βŠ₯ Dec(c)βˆ‰π‘€ 𝑐

19 Authenticated encryption
An Encryption scheme (𝐺𝑒𝑛,𝐸𝑛𝑐,𝐷𝑒𝑐) is an authenticated encryption scheme if Unforgeable CCA-secure

20 Three Candidates for AE from mac + enc
We assume 𝐸𝑛𝑐 is a secure encryption scheme π΄π‘’π‘‘β„Ž is a secure message authentication code Show which two are insecure and which is secure, here are the hint 𝐸𝑛𝑐’( π‘š 1 || π‘š 2 ) = 𝐸𝑛𝑐( π‘š 1 ) || 𝐸𝑛𝑐( π‘š 2 ) is a secure encryption scheme Auth’(m) = (auth(m),m) is a secure encryption scheme Encrypt-and-mac encrypt-then-mac Mac-then-encrypt 𝐸𝑛𝑐 (π‘š) c β€² ←𝐸𝑛𝑐 π‘š 𝑑← π΄π‘’π‘‘β„Ž(m) 𝑐←( 𝑐 β€² ,𝑑) 𝑑← π΄π‘’π‘‘β„Ž(c’) 𝑀←(π‘š,𝑑) c←𝐸𝑛𝑐(𝑀)

21 Insecure schemes Encrypt and mac
Answer: if authentication leaks the message, then this encryption scheme also leaks the message Encrypt-and-mac 𝐸𝑛𝑐 (π‘š) c β€² ←𝐸𝑛𝑐 π‘š 𝑑← π΄π‘’π‘‘β„Ž(m) 𝑐←( 𝑐 β€² ,𝑑)

22 Insecure schemes Mac then encrypt
Answer: Let 𝑐 0 , 𝑑 0 = 𝐸𝑛𝑐 π‘š 0 , 𝑐 2 , 𝑑 2 = 𝐸𝑛𝑐 π‘šβ€² We have that 𝐷𝑒𝑐( 𝑐 2 , 𝑑 0 ) = π‘š 0 if and only if 𝑐 2 = 𝐷𝑒𝑐 π‘š 0 Encrypt-and-mac 𝐸𝑛𝑐 (π‘š) c β€² ←𝐸𝑛𝑐 π‘š 𝑑← π΄π‘’π‘‘β„Ž(m) 𝑐←( 𝑐 β€² ,𝑑)

23 Authenticated encryption with associated (public) data
𝐸𝑛𝑐 π‘‘π‘Žπ‘‘π‘Ž,π‘š β†’(π‘‘π‘Žπ‘‘π‘Ž,𝑐,𝑑) Correctness: 𝐷𝑒𝑐 π‘‘π‘Žπ‘‘π‘Ž,𝐸𝑛𝑐(π‘‘π‘Žπ‘‘π‘Ž,π‘š) =(π‘‘π‘Žπ‘‘π‘Ž,π‘š) Authentication Impossible to create a fresh pair such that: (π‘‘π‘Žπ‘‘π‘Ž,𝑐′) has been seen before Dec π‘‘π‘Žπ‘‘π‘Žβ€™,𝑐’,𝑑’ β‰ βŠ₯ Indistinguishability

24 Galois-counter mode Combines Information theoretic mac with counter-mode Uses one-time mac over binary field. 𝐸𝑛𝑐(π‘‘π‘Žπ‘‘π‘Ž,π‘š) 𝐼𝑉 ∈ 𝑅 0,1 𝑛/2 π‘š 1 ,…, π‘š 𝑑 β†π‘š 𝐴 1 ,…, 𝐴 β„“ β†π‘‘π‘Žπ‘‘π‘Ž π‘˜ 1 ← 𝐸 π‘˜ 𝐼𝑉,0 π‘˜ 2 ← 𝐸 π‘˜ 𝐼𝑉,1 𝑐 1 ,…, 𝑐 𝑑 ←𝐢𝑇𝑅( π‘š 1 ,…, π‘š 𝑛 ;π‘π‘œπ‘’π‘›π‘‘π‘’π‘Ÿ= 𝐼𝑉 || 2 ) πœβ†π‘œπ‘‘π‘š(𝑑,β„“,π‘‘π‘Žπ‘‘π‘Ž, 𝑐 1 ,…, 𝑐 𝑑 ) c←(𝑑,β„“,π‘‘π‘Žπ‘‘π‘Ž, 𝑐 1 ,…, 𝑐 𝑑 ,𝜏)


Download ppt "Authenticated encryption"

Similar presentations


Ads by Google