Bcrypt node js

broken image

Step 3: Let's write our server using express and connect it to MongoDB using mongoose. We will use expressjs to create a new server and mongoose to interact with MongoDB in our node application. Step 2: Installing some of the project dependencies.

broken image

Step 1: Create a new directory and initialize a new project in it using. Let's implement passwords hashing in our node application! Make sure you have the following installed on your system to move forward with the blog Prerequisitesīefore moving on, I am assuming you have some idea about the following: Hashing is called one way because it's practically impossible to get the original text from a hash. Hashing performs a one-way transformation on a password, turning the password into another String, called the hashed password. Hashing is a one-way ticket to data encryption.

broken image
broken image

What if we could prevent this from happening? What if there was a way to prevent a hacker from accessing your user passwords even if your database is compromised? Yes, there is one called Password Hashing. Congratulation, all your user data is compromised. Now some hacker gets access to your database, and they can see any of the user credentials stored in the database and do whatever they want. Imagine a scenario where you store all the user passwords in plain text in your database, i.e., passwords are stored in the database without any modification.

broken image