Subject: bug#13949: fill-paragraph is buggy, but using MD5 is even more buggy

From: Andreas Schwab <[email-masked]>
Date: Mon, 28 Mar 2016 12:32:26 +0200

"Petros Travioli" <[email-masked]> writes:

> But that's exactly what happens when you are using hash functions to
> verify buffer equality, just with a more complicated mathematical
> formulation and at a slightly different scale.
>
> So don't use hash functions to a two-sided correct answer to test buffer
> equality. For a one-sided answer (if hash(x) != hash(y) then x != y), you
> are fine.

There is a difference between a hash function and a cryptographic hash
function.  An inportant property of a cryptographic hash function is the
avalanche effect, that means a small change in the plaintext will result
in a big change in the hash value.  That makes such a hash function
suitable for the reverse condition x != y => hash(x) != hash(y), with a
very high probability of being true.

Andreas.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."