Mission 3: Secure the 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

password: "SecretCode123"
launch_code: "ALPHA-001"

Hackers can read everything!

βœ… Hashed Storage

password_hash: "9af15b..."
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

Loading database...

πŸ”¨ 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:

πŸ†

Mission Validation

Automated Security Check