Interactive Demo — Unit 13: Cryptography Basics

Password Hashing Demo

Type any password and watch it get transformed into a fixed-length string of gibberish. Change one character — the entire hash changes. Add a salt — two identical passwords produce completely different hashes.

Live Hash Generator updates as you type
Algorithm
Your Password
Algorithm
MD5
Hash Output
MD5 Hash 128 bits · 32 hex chars
Hash will appear here as you type...
Avalanche Effect one character change = completely different hash

Change one character in a password and the entire hash changes — not just one character in the output, but the whole thing. This is called the avalanche effect and it's a required property of secure hash functions.

Base Password
Salt Demo why two identical passwords can have different hashes

Without a salt, every user with the password "password" has the exact same hash. An attacker cracks one, they crack them all. A salt is a random string added to the password before hashing — making every hash unique even for identical passwords.

Enable Salting
Toggle to see the difference salting makes
Password
→ Hash
Two users, same password — what the database sees:
User A
User B
Key Concepts
🔁
One-Way Function
You can turn a password into a hash instantly. You cannot turn a hash back into the password. It's a one-way street — mathematically irreversible.
📏
Fixed Length Output
"cat" and the entire text of Harry Potter produce hashes of exactly the same length. The input size doesn't matter — the output is always the same size.
🌊
Avalanche Effect
Change one character in the input and the entire hash changes completely. This makes it impossible to guess what the original input was from a small change in output.
🧂
Salting
A random value added before hashing. Means two users with the same password get different hashes — defeating rainbow tables and bulk cracking attacks.
💥
Collisions
When two different inputs produce the same hash. MD5 and SHA-1 have known collision attacks — one reason they're no longer trusted for security purposes.
🌈
Rainbow Tables
Pre-computed databases of hashes for common passwords. If your password is "password123" and it's unsalted, the attacker already knows the hash before they start.