A security analyst needs to verify that a downloaded file has not been tampered with. The publisher provides a SHA-256 hash. Which property of the hash function is being relied upon?
Trap 1: Avalanche effect
The avalanche effect refers to a small change in input causing a drastic change in output. While important for hash functions, it is not the property directly relied upon for integrity verification using a provided hash.
Trap 2: Collision resistance
Collision resistance ensures that it is hard to find any two different inputs that hash to the same value. However, in this scenario, the attacker is given the original hash and must find a different file with that hash, which is second pre-image resistance. Collision resistance is a stronger property but not specifically required.
Trap 3: Pre-image resistance
Pre-image resistance ensures that given a hash, it is hard to find any input that produces it. However, in this scenario, the analyst already has the original file's hash and is comparing computed hash to that. Pre-image resistance is about reversing the hash, not about finding a different input with the same hash. Second pre-image resistance is the correct property.
- A
Avalanche effect
Why it fails: The avalanche effect refers to a small change in input causing a drastic change in output. While important for hash functions, it is not the property directly relied upon for integrity verification using a provided hash.
- B
Collision resistance
Why it fails: Collision resistance ensures that it is hard to find any two different inputs that hash to the same value. However, in this scenario, the attacker is given the original hash and must find a different file with that hash, which is second pre-image resistance. Collision resistance is a stronger property but not specifically required.
- C
Second pre-image resistance
Second pre-image resistance guarantees that an attacker cannot find a different file producing the same SHA-256 digest as the published one. That property lets the analyst detect tampering, since any altered content yields a mismatched hash.
- D
Pre-image resistance
Why it fails: Pre-image resistance ensures that given a hash, it is hard to find any input that produces it. However, in this scenario, the analyst already has the original file's hash and is comparing computed hash to that. Pre-image resistance is about reversing the hash, not about finding a different input with the same hash. Second pre-image resistance is the correct property.