Alien Defense β Mission 3: Secure the Databases
Learn about hashing techniques and securing databases
CRITICAL SECURITY BREACH
β οΈ ALERT: PLAINTEXT DATA DISCOVERED
Commander, our security audit revealed a catastrophic vulnerability. The launch codes database you built in Mission 1 stores ALL sensitive data in plaintextβpasswords, codes, everything.
Alien scanners can read it like an open book. You must learn cryptographic hashing and secure the database before they intercept our codes!
Time
20 min
Difficulty
βββββ
Reward
Vault Code
Understanding Cryptographic Hashing
What is Hashing?
Hashing is a one-way mathematical function that transforms data into a fixed-length "fingerprint". Unlike encryption, you cannot reverse a hash back to the original data.
β Plaintext Storage
launch_code: "ALPHA-001"
Hackers can read everything!
β Hashed Storage
code_hash: "7c3e2a..."
Unreadable to attackers!
Try It Yourself
Type anything to see SHA-256 hashing in action:
Key Properties
- Deterministic: Same input β Same hash (always)
- Fixed Size: Output is always 64 characters
- One-Way: Cannot reverse hash to original
- Avalanche Effect: Tiny change β Completely different hash
Hash Laboratory
π― Challenge: Verify the Avalanche Effect
Hash these two similar codes and observe how different their hashes are:
π§ͺ Exercise: Hash Launch Codes
Your mission: Hash all launch codes from Mission 1. Enter codes separated by commas:
β Hash Laboratory Complete!
You understand how hashing protects data. Ready to secure the database?
Secure the Database
π Current Database Status
π¨ Your Mission: Add Password Security
Write SQL to add a password_hash column to the Agents table:
π Hash Agent Passwords
Now hash passwords for all agents. The system will do this automatically: