Questions: Hash Functions and Collision Resistance

5 questions to test your understanding

Score: 0 / 5
Question 1 Short Answer

A hash function produces 128-bit outputs. An attacker wants to find a collision. Approximately how many random inputs must they hash before expecting a collision, and what principle explains this?

Think about your answer, then reveal below.
Question 2 True / False

Collision resistance implies second-preimage resistance, but second-preimage resistance does not imply collision resistance.

TTrue
FFalse
Question 3 Multiple Choice

A developer uses MD5 to hash passwords, arguing that while MD5 collisions have been found, preimage attacks are still infeasible. What is wrong with this reasoning?

AMD5 preimage attacks are actually practical and passwords can be directly recovered
BPassword hashing requires collision resistance, not preimage resistance, so MD5's broken collision resistance is the relevant vulnerability
CWhile MD5's preimage resistance is not fully broken, password hashing has additional requirements (slowness, salting) that MD5 does not satisfy. MD5 is fast by design, enabling rapid brute-force and dictionary attacks. Dedicated password hashing functions like bcrypt or Argon2 are needed
DMD5 is fine for password hashing as long as the passwords are longer than 128 bits
Question 4 Multiple Choice

The Merkle-Damgard construction builds a hash function from a fixed-size compression function. What structural vulnerability does it introduce that newer constructions like SHA-3 (sponge) avoid?

AMerkle-Damgard hashes are vulnerable to timing attacks because they process blocks sequentially
BLength extension attacks: knowing H(m) and |m| allows computing H(m || padding || m') without knowing m, because the hash output is the internal state after processing m
CMerkle-Damgard cannot process messages longer than 2^64 bits
DThe compression function must be collision-resistant, but SHA-3's sponge construction does not need a compression function at all
Question 5 True / False

SHA-256 always produces a 256-bit output regardless of whether the input is 1 byte or 1 terabyte.

TTrue
FFalse