
Day 37 of #100DaysOfCode — Authentication Part I: Hashing Passwords
When building authentication systems, one of the biggest security mistakes that can be made is storing passwords in plain text . If your database ever gets leaked, every user’s password becomes instantly visible. That’s why modern applications never store real passwords — they store hashed passwords . For Day 37, the goal was to understand: Why password hashing is important What hashing actually means What salting is How to hash passwords using bcrypt How login verification works How to implement this in a Node.js + MongoDB backend Why Password Hashing Is Important A bad implementation looks like this: { "email" : "user@email.com" , "password" : "mypassword123" } If the database is compromised, attackers can instantly see user passwords. This becomes dangerous because: Many users reuse passwords Attackers can access other accounts (email, banking, social media) The Correct Way: Store Hashed Passwords A secure implementation stores a hashed version of the password: { "email" : "user@ema
Continue reading on Dev.to
Opens in a new tab



