String hashing was: Thou shalt have no other gods before the ANSI C standard 1543
Randy Howard Yeah but rather than forcing all the other hashes to notice '-0' termination, I chose instead to force this hash function to obey length termination. I don't think it makes a...
Sorry for posting this in sci.crypt, but my hash function is specifically *NOT* recommended for any kind of signature or data integrity check. Its better than xoring the input bits together, but not much better. I don't think it even rises to the level of CRCs for data integrity checks.
Its meant for hash tables where an attacker is not likely to have the inclination or resources or patience to attack it.
Specifically, there are data patterns than be input into the hash function of the form:
Special-Header + Any number of 0s + Any fixed tail
(all aligned to 32 bits except the tail) that all hash to the same thing. The point is that the only complicated thing to come up with is the Special-Header, which can just be searched for in a 2^32 space.
So it should be obvious that one would *not* want to use my hash function for security purposes. At the very least there would need to be a hidden randomly generated secret prefix of your data to prevent the above attack (probably good enough in practice, modulo the ability to obtain a "secure random header").
-- Paul Hsieh