Lecture 5 - MAC Flashcards

(18 cards)

1
Q

What is the motivation behind Message Authentication Code?

A

How can receiver Bob be sure that the message m came from sender Alice and wasn’t intercepted and/or altered by an attacker? The goal is to preserve confidentiality and integrity of messages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does MAC consist of?

A

MAC consists of 3 algorithms

Gen - Key Generation
Mac - Tagging algorithm
Vrfy - Verification algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does MAC consist of by definition?

A

A message authentication code (MAC) is a tuple (Gen, Mac, Vrfy) where

Gen - Probabilistic key generation algorithm that on input 1^n returns k <– K with |k| >= n
Mac - Tag algorithm that on input k and m ∈ M returns t ∈ T. We write t <– Mac(k,m)
Vrfy - Deterministic verification algorithm that on input of a key k, a message m and tag t, outputs a bit b

For each k and m it holds:
Vrfyk(m, Mac(k,m)) = 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When is t a valid tag?

A

If Vrfyk(m,t) = 1 holds, then we call t a valid tag for the message m.

If MAC is deterministic, than Vrfy works as follows:
- Compute t’ = Mac(k,m)
- Output 1 if t’=t, otherwise output 0

In this case Vrfy does not need to be defined, so called canonical verification

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the MAC security game

A
  • The attacker picks some messages and sends them
  • Oracle calculates tag and sends back
  • Attacker analyzes and attempts to create a new message and send a tag with it (forged by the attacker)
  • If the message isn’t the original message, and the tag is valid (verify re-calculates it), oracle returns 1 otherwise 0

A MAC is secure if:
for all probabilistic polinomial time (efficient) attackers A there exists a negl() such that, the probability the attacker forges a valid MAC is less than or equal to negl(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name different kinds of MACs

A
  1. Information-theoretically secure MACs
    - However, these constructions are not efficient for authentication of many messages
  2. Complexity-theoretically secure MACs
    - For messages of fixed length
    - For messages of arbitrary length (theoretical construction)
    - For messages of arbitrary length (practical construction): e.g. CBC-MAC and HMAC
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain Information-theoretically secure MACs and give an example

A

There exists no adversary A who can generate a valid tag for message m without knowing the key k

Example (one-time MACs):
Given a valid message/tag pair (m,t), it is difficult for an unbounded adversary to create another valid pair (m’,t’)

Construction:
- Let p be a prime number and Zp the natural numbers modulo p
- Let be M = T = Zp and K = Zp x Zp
- Secret key (a,b) ∈ K

  • Mac(k,m) = a x m + b
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain Complexity-Theoretical MACs for fixed length messages.

A

Construction idea: F: K x Y –> Y be a PRF. Define the construction 𝜫 = (𝐆𝐞𝐧, 𝐌𝐚𝐜, 𝐕𝐫𝐟𝐲) with key-space 𝑲, message-space 𝑿 and tag-space 𝒀 as:
- Gen(1^n): outputs k, with k <-R- K
- Mac(k,m): For each message m ∈ X, output t = Fk(m) ∈ Y
- Vrfyk(m,t): output 1 if t = Fk(m); otherwise output 0

If F is a PRF, then 𝚷 is a secure MAC for fixed message length.
- F is indistinguishable from a random function
- The output of a random function can only be guessed with the probability of 2^(-n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain the theoretical construction of complexity-theoretically secure MACs for arbitrary length messages.

A

Problem: previous approaches only work for fixed length messages

Solution: Domain Extension

Idea1: Split message into blocks and auth individually - Permutation (BAD)

Idea2: Add a counter. Can be split per prefix and figured out that way

Idea3: Add ℓ: = |𝒎| to each block! Can be split so that t’’ is valid for m’’

Idea4: Add a random value r. The previous attacks no longer work since MAC isn’t deterministic anymore. Therefore, this is secure!

If m isn’t long enough we can add padding. (0s)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain generic domain extension.

A

Let (Gen, Mac, Vrfy) be a MAC for fixed message length, then adding a random value r and padding (MAC’) will be secure for messages of arbitrary length.

Formal proof requires reduction:
- Assume that there exists adversary A’ that breaks MAC’ with non-negligible probability.
- Then, we can construct another adversary A that breaks (Gen, Mac, Vrfy)

Conclusion: There exists MAC Domain Extension from PRFs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What’s the drawback of the theoretical approach?

A

It’s not efficient, MAC with that construction will be executed O(d) times

Length of the tag is O(dn) bits

Alternative: CBC-MAC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain CBC-MAC

A

Cipher Block Chaining MAC is performed as follows

Pass block 1 through Fk, then XOR output with block 2 and pass again, then XOR, pass, XOR, pass… At the end when the n-1 block is XORed with block n and passed through the Fk, the output is the message tag.

Vrfy(m,t) - calculates the tag again, and checks if the tag is the same, if so, message is authentic (canonical verification)

If F is a block-cipher (PRF), then CBC-MAC is a secure MAC for messages of arbitrary length.

Important: Construction only secure for messages of same length
Solution: To authenticate messages of any length, the message length has to be transmitted as the first block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What’s the difference between CBC-MAC and CBC Encryption?

A

CBC - Uses a random initial value IV (important for SEC)
CBC-MAC - No IV, can be deterministic

CBC - all intermediate values are part of the output
CBC-MAC - Only the final block is output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What’s the procedure to develop authenticated encryption? What problem is common?

A
  • Use API for CPA-secure encryption (e.g. CBC with random IV)
  • Use API for MAC (e.g. HMAC)
  • Combine both without a good understanding of security

Problem: Not every combination results in secure authenticated encryption

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What’s Authenticated Encryption?

A

Authenticated encryption is a tuple (Enc, Dec) with:
- Enc: K x M –> C (as usual)
- Dec: K x C –> M ∪ {⊥} (ciphertext rejected if it is incorrect)

Ideal secure communication:
Confidentiality (Strong confidentiality = CCA security)
+
Integrity (Unforgeability)

A symmetric encryption scheme 𝛱 = (Gen, Enc, Dec) is an authenticated encryption scheme, if 𝜫 is secure and unforgeable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain Generic construction of Authenticated Encryption

A

If there exists a CPA secure encryption
and there exists a secure Strong-MAC

it implies

exists authenticated encryption scheme

17
Q

Explain ideas of Authenticated Encryption construction.

A

Idea1 (encrypt and mac)
Enc(m, k1, k2) = Enc(m,k1), Mac(m, k2)
- Very error prone depending on method used
- MACs have no hiding property!
- Many practical MACs are deterministic - no CPA security! (DO NOT USE!)

Idea2 (MAC then encrypt)
𝐄𝐧𝐜 (𝒌𝟏||𝒌𝟐, 𝒎) = 𝐄𝐧𝐜′ (𝒌𝟏, 𝐌𝐚𝐜′′(𝒌𝟐, 𝒎)||𝒎)
- Secure? It depends.
- Generic: No! We can construct a scheme that isn’t CCA secure
- Special constructions: Yes, e.g. Rand-CTR + one-time MAC

Idea3 (Encrypt than MAC)
𝐄𝐧𝐜 (𝒌𝟏||𝒌𝟐, 𝒎) = (𝒄′ ≔ 𝐄𝐧𝐜′ (𝒌𝟏, 𝒎) , 𝐌𝐚𝐜′′(𝒌𝟐, 𝒄′))
- Secure? Yes, always a good idea!
- Prove CCA security and unforgeability by reduction
- k1 and k2 shouldn’t be reused because MAC vrfy reveals information about the plaintext.

18
Q

Name standards for AE (Authenticated Encryption).

A

GCM - CTR mode encryption, then special MAC in Galois-field (e.g., IPsec)

CCM: CBC-MAC, then CTR Mode Encryption (802.11i)

EAX: CTR mode encryption, then OMAC

OCB: Requires only one call to the underlying block cipher per block

All supported authenticated encryption with associated public data

———————–|——encrypted—-|

{Associated Data}{Encrypted Data}

|————-Authenticated—————-|

Speed values can be found on second-to-last page of Lect 5 Message Authentication Codes