Hash functions Flashcards

1
Q

When is a function H is called cryptographic hash function?

A
  1. H is one way function (1st pre image resistance) -> for all outputs y, it is computational infeasible to find x with H(x) = y.
    2.2nd pre image resistance -> given x, it is computational infeasible to find x’ with x != x’ such that H(x) = H(x’)
    3.collision resistance -> it is computationally infeasible to find a pair (x,x’) with x != x’ such that H(x) = H(x’)
    4.Random oracle property ->it is computationally infeasible to distinguish H(x) from a random n-bit value.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is MAC and why do we need them?

A

Message authentication code is including a shared secret key in the hash. MACk(m) = h(m,k)
Hashing is not enough for ensuring integrity. An attacker can intercept the message and change the message and calculate its hash for the new message and send it to the victim. (important to remember that hash algorithms are public)

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

Explain the steps of how the sender and receiver can ensure the integrity of the message using MAC?

A

Alice and Bob share a symmetric key.
Alice wants to send m to bob, she calculates the MACk(m) and send the m and the calculated MAXk(m).
once Bob receives the message, he calculate the MAC for the m he received and he compared the MAC he received and the MAC he calculated, if they are the same, then the integrity is ensured.

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

What is HMAC and how is it calculated?

A

HMAC is a specific MAC algorithm.
HMAC = H(K XOR OPAD | H(K XOR IPAD | m))

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