# 3.1 Cryptographic Hash Functions

Cryptographic hash functions are mathematical algorithms that produce unique, fixed-size outputs for any input, and are used for data integrity and security.

An essential tool in blockchain technology is the cryptographic function that ensures transaction integrity and immutability. The hash function is the mathematical algorithm that produces a fixed size numerical output (called fingerprint or digest) consisting of input data. More specifically, a hash function can be denoted as:
`H:{0,1}*→ {0,1}ᵏ `

A hash function takes on the input of any size and produces a fixed k length output. In addition, it must satisfy the following properties:
● It is easy to compute H regardless of input data size.
● Given any h, it is computationally infeasible to find an input x such that H(x) = h.
● Given any x, it is also computationally infeasible to find y such that H(y) = H(x) and x≠ y.
● It is computationally infeasible to find any (x, y) such that H(x) = H(y) and x≠ y.

SHA-256 and Keccak-256 are widely used in several blockchains, and they produce a hash (output) of 256 bits in size.

Last updated