Hash functions

Hash value/digest

A fixed-length code sequence outputted by a hash function

\

Hashing

A one-way process that maps variable-length data to a fixed-length hash

\

Hash function

An algorithm that takes a piece of data and outputs a hash value

  • Can take data of any length as input
  • Outputs a hash value of fixed-length
  • Relatively easy to compute the hash function (H()), given the input (X)
  • Deterministic (meaning that given the same X, we get the same H(X))
  • Knowing the hash of something shouldn't give you any information about what data got put into the hash function

\

Hash function properties
  • Weak-collision resistance property - Given an input X and a hashing function H(), it's very difficult to find another input Y on which H(X) == H(Y)
  • Strong-collision resistance property - Given a hashing function H() and two inputs X and Y, there exists an absolute minimum chance of H(X) == H(Y)
  • One-wayness property - Hashing functions can compute hashes given the original data as input but they can't restore it back to the original data by passing its hash value through the hashing function again \n   * Collision - When different data inputs result in the same hash after being processed by a hashing function

\