🔐 Cryptographic Hash Functions – Basics
✅ What is a Hash Function?
A hash function takes any input (text, file, password, etc.) and produces a fixed-length output, called
a hash or digest.
✅ Properties of Cryptographic Hash Functions:
1. Deterministic: Same input always gives the same output.
2. Fast Computation: Hash value is generated quickly.
3. Irreversible (One-way): You can't get the original data from the hash.
4. Collision-resistant: No two different inputs should produce the same hash.
5. Avalanche effect: A small change in input drastically changes the output.
✅ Common Hash Algorithms:
MD5 (128-bit, but outdated and insecure now)
SHA-1 (160-bit, also weak now)
SHA-256 (256-bit, secure and widely used)
SHA-3 (next-gen, highly secure)
✅ Applications:
Password storage (store hash instead of plain text)
Data integrity verification (file checksums)
Digital signatures
Blockchain (e.g., Bitcoin uses SHA-256