KoreField
Lessons/Cybersecurity and AI Security/Beginner/Security Fundamentals

Hashing and Password Verification

35 min Coding Lab
Hash passwords using a secure algorithmVerify passwords against stored hashesUnderstand salting and why it prevents rainbow table attacks

AI Avatar Lesson

Video will be available when Cloudflare Stream is configured

35 min
Coming Soon

Password Hashing in Practice

When a user registers, you hash their password and store the hash. When they log in, you hash the submitted password and compare it to the stored hash. If they match, the password is correct — without ever storing the plain text.

Salting

A salt is a random value added to the password before hashing. It ensures that two users with the same password produce different hashes, defeating precomputed rainbow table attacks.

Key Takeaway

Always salt and hash passwords with a slow algorithm (bcrypt, argon2). Never roll your own crypto.

Review Questions

1. What does a salt prevent?