Would this hash functionality fall under pre-image resistance or collision resistance? I understand that there are three main security requirements for hash functions, pre-image resistance, second pre-image resistance and collision resistance.

I need to write about a hash function that allows the user to identify if the original hashed items are identical, but I am a little confused to which security feature this falls under. I understand that its best that no hashed items create the same digest, but in this case its a requirement.

Would this fall under pre-image resistance, since often this is when the random salt is added? Or simple collision resistance? As collision resistance stops hashed values from equaling the same value.

I am a little confused since I do not want different inputs equaling the same output, only identical ones.
I do not want different inputs equalling the same output, only identical ones.


That is pretty much the definition of collision resistance:


  a hash function H is collision resistant if it is hard to find two inputs that hash to the same output; that is, two inputs a and b such that H(a) = H(b), and a ≠ b.


Of course, no hash function can guarantee that the same hash values means the same input. Consider the case where you are hashing files up to 2 gb into 256-bit hash strings. So there are $2^{8000000000}$ possible inputs and only $2^{256}$ possible outputs. Many many possible files will map to each hash string.

So you can never guarantee that identical hashes means identical inputs, but you can rest easy that with a good cryptographic hash function, it is computationally infeasible for an attacker to build two inputs with the same hash (collision resistance), or to take a given input and find a second input with the same hash value (second pre-image resistance).