Re: Q: How to test new hash algorithm?



Martin Hvidberg wrote:

That makes sence... I guess an optimal hash would change all allong the output string (or change all the digits) if you change just a singel char in the input.

Not at all. Changing all of the bits is exactly the same as not changing anything -- with an "optimal" hash function, any change at all in the input, including a change in just *one bit* of the input produces an output that is statistically uncorrelated to the former; when you think about it, in average you would expect *half* of the output bits to change.

Regardless of how "non-fancy" your requirements are, I would
*strongly* suggest that you go for something standard, even if
a simple CRC, as already suggested.

You could check Wikipedia for a description (in "pseudo-Pascal")
of hashes like SHA-1 or MD5.

I wonder if a SHA algorithm with fewer rounds (so that you can
code something more efficient) would fit the bill of having the
right statistical properties even if it sacrifices strength
against cryptanalysis (which seems to be of no concern for you).
I will leave that one for the experts out here.

HTH,

Carlos
--
.