4 ms·
As a dev you should take a look at the difference of hashes/s of the different algorithms. Some are measured in GH/s, some in MH/s, some only kH/s. E.g. MD5 is
by cleeus 9y ago
As a dev you should take a look at the difference of hashes/s of the different algorithms. Some are measured in GH/s, some in MH/s, some only kH/s. E.g. MD5 is way faster then SHA256. So if you only use a strong hash for ensuring data integrity in the absence of adversaries and performance matters, you may prefer MD5 even in these days.
- ComputerGuru 9y agoThere's no good reason to use md5, period. If performance matters and security doesn't, use something like mmhash3. If security matters and speed doesn't, use something like SHA-512 (optionally truncated to 256 bits). If both matter, use something like siphash if a prf will do or blake2 if you need a true, high-speed cryptographic hash. (Actually, besides portability and interoperability, there's probably no good reason to use SHA-anything over blake2. Although if you are working in environments that provide hardware crypto support (Intel SHA Extensions on Atom, now also supported on Ryzen so maybe we'll see it on the desktop, too), SHA becomes faster than blake2 and you should use that instead.) If at any point you find yourself in a situation where your hash being computed too fast poses a security risk, that should be a HUGE warning. Hashes should be fast, cryptographic or otherwise. If you need a "slow hash" you are probably looking for a derivation algorithm and not a hash and should be looking at scrypt, bcrypt, or even pbkdf2.
- cleeus 9y agoI have not looked deeply at mmhash3 (I guess it means murmurhash3), but wikipedia says: [...] When using 128-bits, the x86 and x64 versions do not produce the same values [...] which will make it unsuitable for cross-platform applications. I was talking about a usecase where you could also choose CRC32 from a security standpoint but want more collision resistance. How does blake2 performance compare to MD5?
- aappleby 9y agoThe wikipedia page might be a bit misleading - there's a 128-bit murmur3 that uses 32-bit math (works well on most every processor), and a 128-bit murmur3 that uses 64-bit math (much faster on 64-bit processors, much slower on 32-bit ones) -Austin, Murmur author.
- cleeus 9y agoah, so there is mm3-128-32 and mm3-128-64 that makes it actually a viable alternative to MD5