Week 5: Hash Functions Flashcards
What does a cryptographic hash do?
A cryptographic hash maps a string into a new shorter string.
What are some applications of Hash Functions?
- Secure password storage.
- Integrity Checks
- Fingerprinting
What is an Ideal Cryptographic Hash?
Input: Arbitrary-length string
Output: Fixed length string
Each repeated input gives same output as before. Each output is unique.
What are the Security Properties of a Hash Function?
- Pre-image resistance
- Second pre-image resistance.
- Collision resistance.
In Hash Functions, what is Pre-image resistance?
Given hash [h(x)], it should be hard to find a message [x] that produces that hash [h(x)].
Given h(x), hard to find x.
In Hash Functions, what is Second pre-image resistance?
Given message [x1], it should be hard to find another message [x2] that produces same hash.
Given x1, h(x1) hard to find x2 where h(x1) == h(x2)
In Hash Functions, what is Collision resistance?
It should be hard to find any two messages x1, x2 that produce same hash.
Hard to find any messages x1, x2 where h(x1) == h(x2)
Given a hash length, how many messages do you need to look through to have collision?
Collision will occur after 2^(k/2) attempts. Where k is hash key length.
How does Merkle-Damgard Construction work?
- Initial Value and first message block is fed into compression function.
- Output from 1 and second message block is fed into compression function.
…
Final output is the hash.
How does a SHA-1 Compression Function work?
- Pads input message if necessary.
- Split input message into 32 bit chunks.
- Start with 5 input constants (IV) and modify each through bitwise operations as you loop through chunks.
- Output final (32*5) 160 bit message.