From the course: Databases for Node.js Developers

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

Securing credentials with password hashing

Securing credentials with password hashing - Node.js Tutorial

From the course: Databases for Node.js Developers

Securing credentials with password hashing

- [Instructor] In our last video, we discussed the dangers of storing passwords in plain text. Now we will implement secure password hashing in our model. Instead of storing passwords directly as you see it here, we will transform them into hashed version using a one-way function. This ensures that even if the database is compromised, passwords remain protected. Under the hood, we will also use salting, which adds randomness to each hash, preventing attackers from exploiting duplicate passwords. For this, we will use Argon2, a modern secure hashing algorithm designed to resist brute force attacks. Let's get started. So I head back into Visual Studio Code, and there first we'll install Argon2. So I type npm install Argon2 into my terminal. Then I start my application right away, and then we have to go into the model because we want to build this functionality directly into the database model. And for that I go to models, Sequelize, and there I open user. And in user I will first bring…

Contents