Hash functions transform input data of any length into a fixed-length output known as a digest. A secure hash function must be irreversible, resistant to finding a second preimage, and resistant to collisions.
For practical security, a minimum digest size of 256 bits is recommended. This size provides 128 bits of security against collision attacks, which is necessary because the birthday paradox dictates that collisions occur much faster than the total number of possible outputs.
Hash functions are widely used in cybersecurity for password storage, such as Argon2 or bcrypt, and for verifying the integrity of files from CDNs. They also enable commitment schemes, allowing users to prove knowledge of data without revealing it prematurely.






