1

I would love to understand at the most basic level what their differences are. When is each one used?

Any advantages and disadvantages?

2

An example of a cryptographic hash function is SHA256. An example of a non-cryptographic hash function is CRC32.

A cryptographic hash could be used, for example, for a cryptographically strong Message Authentication Code (MAC, or, in practice, as a component of HMAC for key-based integrity) or as a component in an authentication encryption (AE or AEAD) scheme. Here, the meaning of "cryptographically strong" is that the hash function satisfies certain properties such as, for example, the hash value (the output of the hash function) doesn't have any collisions that, for example, could be exploited by an attacker. For more information, the book "Introduction to Modern Cryptography" by Katz and Lindell discusses properties of cryptographic hash functions.

A non-cryptographic hash could be used, for example, as a checksum for a small amount of data if you are not worried about an attacker trying to modify it. E.g., some data stored in an EEPROM only accessed by other trusted components on a circuitboard.

  • Probably worth pointing out that cryptographic hashes generally shouldn't be used by themselves as a MAC, but as part of a construction such as HMAC or KMAC – AndrolGenhald Aug 4 at 21:37
  • 1
    Thanks, I updated the answer to mention HMAC in practice – hft Aug 6 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.