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 Does a Cryptographic Hash Function Ensure Data Integrity?
What Is the Difference between a Preimage Attack and a Collision Attack?
What Is a “Hash Collision” and Why Is It a Critical Concern for Blockchain Security?
Besides Pre-Image Resistance, What Is Another Crucial Security Property of a Cryptographic Hash Function?
What Is the Birthday Paradox and How Does It Relate to the Probability of Finding a Hash Collision?
What Is the Difference between a Preimage Attack and a Collision Attack in Hashing?
What Is the “Birthday Problem” in Cryptography and How Does It Relate to the Risk of Hash Collisions in SHA-256?
What Is a “Preimage Attack” and How Does It Differ from a Collision Attack?

Glossar