8 - Cryptographic Hash Functions Flashcards

1
Q

Applications of hash functions

A
  • Hash tables
  • Checking integrity
  • File comparison for searching
  • Cryptography
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Requirements of crypto hash function H

A
  • Input of H is of any length
  • H output has fixed short length and is called the hash value
  • H(x) is relatively easy to compute
  • Random inputs should result in uniformly distributed outputs
  • Small changes should be likely to produce a change in output

One-way / preimage resistance:
- For h, unfeasible to find x H(x) = h

Weak collision resistance/second preimage:
- For x, unfeasible to find y where H(x) = H(y)

Strong collision resistance
- Unfeasible to find ANY pair x and y where H(x) = H(y)
( Can pick both inputs, rather than given one in weak)

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

If a hash function is not one-way…

A

A hacker could find the message that has the message digest and then present the message as being signed by Bob

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

For all files of 1MB and a 256bits output, can we assign a unique hash to everything

A

No. The number of possible files is much bigger than the output size.

Some hashes would not be unique.

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

Collisions in hashing

A

two inputs hashing to the same output

Typically, collisions WILL happen.
- Require that collisions should be hard to find so that brute force takes too long and theres no other better method.

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

Possible attack if H is not weak collision resistant

A
  • message x with sig s
  • find another y with H(x) = H(y)
  • y with sig s passed as though genuinely signed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Possible attack if H not strong collision resistant. (Birthday Attack!)

A
  • Several versions of valid x and fraudulent doc y until H(x)=H(y)
  • Sign x to get s
  • Substitute in y with sig. s
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Birthday Attack

A
  • n bit output hash
  • find H(x)=H(y)
  • approximately 0.5 success after hashing ~2^*(n/2) inputs

Hash should be 160 (2^80 computaitons for brute force) bits min but more commonly 256bits

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

Recommended Hash functions

A

SHA-2: SHA-256 and SHA-512

SHA-3 also exists

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

Breaking a hash function

A

Are there methods for finding collisions significantly quicker than brute force

MD5, RIPEMD-160 and SHA-1 have been broken this way

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

Applications of hash functions

A
  • Digital signatures
  • PAssword storage
  • Blockchain
  • Proof of work
  • Message auth codes
  • Creating Keys
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When storing passwords, why is a salt necessary?

A

To mitigate using pre-computed lookup tables by concatenating in a “salt” value before submitting a password.

Unique salt per user

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