by ademarre · 11y ago · 0 comments
If fear of collisions is the reason you don't use a crypto hash function, then you are using a broken hash function.
A hash doesn't satisfy all the requirements of the problem, but it's not because of collisions.
This fact applies to any hash function even those you don't consider broken.
As optimiz3 already pointed out, a critical property of crypto hash functions is extreme difficulty in finding collisions, let alone meaningful ones. So if a hash function passes muster cryptographically, then we can use it to practically assert equality of inputs.
In other words, it's so improbable that we treat it as if it's impossible. When that assumption is not safe to make anymore, that's when we upgrade to a new hash function.
> Imagine if your '==' operator only worked 99 times out of a hundred.
Imagine if the probability of your '==' operator failing was 2^(-128). I would be fine with that. And that's the same "gamble" made by any protocol that relies on the collision resistance of SHA-256. You would have to try 1 quadrillion per second for 10 quadrillion years before having a 50% chance of hitting a collision.
If a hash function is cryptographically secure, it has the property where finding collisions is infeasable, which makes it suitable for evaluating equality.
This is why cryptographic hash functions are used as a proxy for passwords in order to avoid storing the plaintext.
"If a hash function is cryptographically secure, it has the property where finding collisions is infeasable, which makes it suitable for evaluating equality." This is so wrong.
It has a high probability of evaluating equality but in no way is it suitable. The primary benefit that cryptographic hash functions offer is that it is impractical to conduct a chosen plaintext attack.
"This is why cryptographic hash functions are used as a proxy for passwords in order to avoid storing the plaintext."
This is true, and is due to preimage resistance and the infeasibility of a chosen plaintext attack.