Hash Functions - Quick Guide
What is a Hash Function?
A hash function is a mathematical algorithm that maps data of arbitrary size to a fixed-size output. This output
is known as a hash value, digest, or checksum.
Key Properties of Hash Functions
- Deterministic: Same input always gives the same hash.
- Fast Computation: Quickly computable.
- Pre-image Resistance: Hard to find input from hash.
- Small Changes = Big Difference: One-bit change = very different hash.
- Collision Resistance: Hard to find two inputs with same hash.
- Fixed Output Size: Consistent output length regardless of input size.
Applications of Hash Functions
- Data Integrity: Verify data hasn't changed.
- Cryptography: Used in digital signatures and certificates.
- Password Storage: Store hashes instead of passwords.
- Data Structures: Fast lookup in hash tables.
- Blockchain: Link and secure data immutably.
Popular Hash Algorithms
- MD5 (128 bits): Fast but insecure.
Hash Functions - Quick Guide
- SHA-1 (160 bits): Better than MD5 but deprecated.
- SHA-256 (256 bits): Secure and widely used.
- SHA-3: Latest secure hash family (Keccak-based).
Vulnerabilities
- Collision Attacks: Two inputs = same hash.
- Pre-image Attacks: Input matching a hash.
- Rainbow Tables: Precomputed hashes to crack passwords.
Best Practices
- Use secure hash functions (SHA-256, SHA-3).
- Add salt to passwords to defend against rainbow tables.
- Avoid MD5 and SHA-1 in secure contexts.
NAME: BASLEAL GETANEH
ID NO : RCD/1173/2016
Section F