Non-cryptographic Hash Functions

See: List of non-cryptographic hash functions

Pearson hashing

  • Pearson hashing is a hash function designed for fast execution on processors with 8-bit registers.
  • This hash function is a CBC-MAC that uses an 8-bit substitution cipher implemented via the substitution table.
  • An 8-bit cipher has negligible cryptographic security, so the Pearson hash function is not cryptographically strong, but it is useful for implementing hash tables or as a data integrity check code,
  • For a given string or chunk of data, Pearson’s original algorithm produces only an 8-bit byte or integer, 0–255.
  • It can be made to generate hashes of any desired length by concatenating a sequence of 8-bit hash values, each of which is computed simply by slightly modifying the string each time the hash function is computed. Thus the same core logic can be made to generate 32-bit or 128-bit hashes.

FNV (Fowler–Noll–Vo) hash function

SipHash

  • SipHash is fundamentally different from cryptographic hash functions like SHA in that it is only suitable as a message authentication code: a keyed hash function like HMAC.
  • It was designed to be efficient even for short inputs, with performance comparable to non-cryptographic hash functions, such as CityHash
  • It can be used to prevent denial-of-service attacks against hash tables (“hash flooding”), or to authenticate network packets.
  • An unkeyed hash function such as SHA is only collision-resistant if the entire output is used.
  • By using a key unknown to the attacker, a keyed hash function like SipHash prevents this sort of attack (attacker sends a few hundred requests all chosen to have the same hash value to the server, that will produce a large number of hash collisions)
  • SipHash is used in hash table implementations of various software

In cryptography, a message authentication code (MAC), sometimes known as a tag, is a short piece of information used to authenticate a message—in other words, to confirm that the message came from the stated sender (its authenticity) and has not been changed. The MAC value protects a message’s data integrity, as well as its authenticity, by allowing verifiers (who also possess the secret key) to detect any changes to the message content.

MurmurHash

  • MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup.
  • The name comes from two basic operations, multiply (MU) and rotate (R), used in its inner loop
  • Jean-Philippe Aumasson and Daniel J. Bernstein were able to show that even implementations of MurmurHash using a randomized seed are vulnerable to so-called HashDoS attacks.
  • They recommend to use their own SipHash instead.

Java: https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/digest/MurmurHash3.html

JavaScript: https://www.npmjs.com/package/murmur

References

Leave a Comment

Your email address will not be published.

5 × five =