4 ms·
Never use MD5 except for compatibility.
by dagenix 7y ago
Never use MD5 except for compatibility.
- lucb1e 7y agoThis. There are hash functions that are faster than MD5, so it's not the fastest, and everyone knows (since 1996, actually[1]) that MD5 is insecure. If you want transmission error checking, use CRC32 or Siphash or whatever. If you want an actual, cryptographic hash function, then BLAKE3 is one of the options, though it's a very young one so unless you really know what you're doing, you should probably not use this for another few years. Heck, if anything in this comment is new to you, you'll want to steer clear of such low-level decisions and just use a library that makes the decision for you. [1] https://en.wikipedia.org/wiki/MD5 https://en.wikipedia.org/wiki/MD5 "In 1996, Dobbertin announced a collision of the compression function of MD5 (Dobbertin, 1996). While this was not an attack on the full MD5 hash function, it was close enough for cryptographers to recommend switching to a replacement, such as SHA-1 or RIPEMD-160."
- rhn_mk1 7y ago> Heck, if anything in this comment is new to you, you'll want to steer clear of such low-level decisions and just use a library that makes the decision for you. This reads very condescending: I posed the question to learn something, not be told off.
- lucb1e 7y agoI'm sorry, I hate it when others do that and don't notice when I do it myself apparently. It was really just meant to be read in the literal sense and not as that such a person is of less value or stupid. It can easily (and has) lead to security breaches if assumptions are made about this. I'm not saying you don't know the difference between md5 and crc32, but if anyone doesn't yet know that, then it's risky to make decisions about these things until they learn more. Cryptographers commonly advise non-experts to use a library to do things for you (even those that know a bit more) since cryptography can be very subtle, but clearly I should have phrased that better.
- rhn_mk1 7y ago> Cryptographers commonly advise non-experts to use a library to do things for you On the high level, the problem is that libraries are usually "CRC32", "MD5", "SHA256", etc. There's no guiding resource that I have found that matches use cases to libraries, which is where the initial question comes from. That is, unless you meant a library that covers the entire use case, but there isn't always one.
- SAI_Peregrinus 7y agoThat's part of why NaCl, Libsodium, and Libhydrogen have the APIs they do: they cover secure ways to use the primitives, make those ways easy, and make it harder to misuse things. It's also why so many security professionals like the "noise" protocol: it doesn't leave any of the difficult choices open to be misused.