Hash functions are mathematical functions that compress an input of arbitrary length into a fixed-length output called a hash value. They have several key properties including:
- Fixed length output regardless of input size
- Fast computation of hash values
- Pre-image, second pre-image, and collision resistance, making it difficult to derive the input data from its hash or find two inputs with the same hash
Common applications of hash functions include password storage by storing hashed passwords rather than plaintext, and data integrity checks by comparing hashed files to detect unauthorized changes. Popular hash functions are MD5, SHA-1/2, RIPEMD, and Whirlpool.