Live data from Hacker News

Which hashing algorithm is best for uniqueness and speed?

programmers.stackexchange.com

11–20 of 110 posts

Re: Which hashing algorithm is best for uniqueness and speed?

#12
post #7
post #2

isn't slow better in this case? I mean if it's fast to generate, it's fast to crack, right?

Given Moore's law and the prevalence of botnets and cloud computing - hash speed really isn't a very strong means of defence against cracking... Also see: http://cyberarms.wordpress.com/2010/10/21/cracking-14-charac...

Uh? Hash speed is pretty much the only means of defense against brute-force cracking (assuming the hash function isn't broken and the attacker has no other vector available).

(low) hash speed is the whole point of PBKDF2, bcrypt or scrypt.

Re: Which hashing algorithm is best for uniqueness and speed?

#14
FNV despite much popularity is a relatively poor quality hash. Murmur2 has a major flaw, hence Murmur3. CRC32 is slow. Not mentioned in the post, but if you're thinking Fletcher or Adler, they have terrible distribution. For a fast 32-bit hash, much better to go with Bob Jenkin's one-at-a-time hash (http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-...) which is simpler than Murmur3 and displays much better avalanche characteristics than the other hashes.

Re: Which hashing algorithm is best for uniqueness and speed?

#15

Earlier quoted context omitted.

nobody? This exact problem was a massive issue within the year. https://www.securityweek.com/hash-table-collision-attacks-co...

Using a slower hash would make the issue worse (linearly): the collisions would still be there, but now each insertion would take even more time due to the extra computational cost of the hash.

[deleted]

Re: Which hashing algorithm is best for uniqueness and speed?

#17
post #11

Why did he omit the standards (MD5 and SHA1) from the comparison?

These are not cryptographic hashes. Comparison would be unfair as cryptographic ones are rather slow . These are used in structures like Hash tables or Bloom Filters etc. they need to be very fast and provide reasonable randomness (low collision). Bu their collision rates are very high comparing to say SHA1.

Re: Which hashing algorithm is best for uniqueness and speed?

#19
post #17
post #11

Why did he omit the standards (MD5 and SHA1) from the comparison?

These are not cryptographic hashes. Comparison would be unfair as cryptographic ones are rather slow . These are used in structures like Hash tables or Bloom Filters etc. they need to be very fast and provide reasonable randomness (low collision). Bu their collision rates are very high comparing to say SHA1.

>@Orbling, for implementation of a hash dictionary. So collisions should be kept to a minimal, but it has no security purpose at all. – Earlz

SHA-1 is very fast though so it is a good point for comparison.

Post reply on HN