What is a Hash Function?
A simple introduction to digital fingerprints
Think of a hash as a digital fingerprint
Human Fingerprint
Unique to each person
Digital Hash
Unique to each piece of data
Simple Definition with Example
A hash function takes any input (text, file, data) and creates a fixed-size fingerprint called a hash.
Basic Example:
The Avalanche Effect:
See what happens when we change just one character:
This is called the Avalanche Effect.
Key Properties of Hash Functions
Deterministic
Same input → Same output every time
Fixed Length
Output always same size
Avalanche Effect
Tiny change → Completely different hash
One-Way
Cannot get input from output
Where Hashes Are Used
Software Updates
How: Your phone or computer checks the hash of an update before installing it.
Why hash helps: If the file was modified, the hash changes and the system detects it.
Password Storage
How: Websites store hash of your password, not the password itself.
Why hash helps: One-way property → attackers can't reverse it.
Blockchain
How: Each block contains hash of previous block.
Why hash helps: Avalanche effect → changing data breaks the chain.
File Verification
How: Download sites show hash so you can verify file integrity.
Why hash helps: Deterministic → same file = same hash.
Digital Signatures
How: Hash document, then encrypt hash with private key.
Why hash helps: Fixed length → easier to sign than whole document.
Did You Understand?
Make sure you understand before continuing.