Skip to main content

Can a Hash Function Be Preimage Resistant but Not Collision Resistant?

Yes, a hash function can be preimage resistant but not collision resistant. Preimage resistance means it is hard to find the input for a given output.

Collision resistance means it is hard to find any two inputs that produce the same output. It is possible to construct a function where finding a specific preimage is difficult, but finding a random pair of inputs that collide is easy.

For example, a function that truncates a long hash output can easily be non-collision resistant but still preimage resistant.

How Is a Second-Preimage Attack Different from a First-Preimage Attack?
How Does the Security of a Cryptographic Hash Function Relate to the Concept of “Computational Difficulty”?
What Is the Difference between a Preimage Attack and a Collision Attack?
Besides Pre-Image Resistance, What Is Another Crucial Security Property of a Cryptographic Hash Function?