What Is The Best Algorithm (Bcrypt, Scrypt, SHA512, Argon2) For Password Hashing In Node.js? [1]

This article will explore and compare different hashing algorithms (Bcrypt, Scrypt, SHA512, Argon2) used to store a password in NodeJs in two parts.

Mohammad Yaser Ahmadi
5 min readOct 17, 2022

You must always store passwords in hashing format, not plain text.

Usually, every tutorial for NodeJS has a section about authentication, and always uses a hash algorithm for storing passwords in the database.

In this article, we want to show you how to use different hashing algorithms that are popular such as Bcrypt, Scrypt, SHA512, and Argon2, and compare these algorithms together to help you choose the best method for hashing passwords in your projects.

I never write articles for google so without waste of time let’s start :)

The repository Code in GitHub: https://github.com/myas92/Hashing-Password-Ways-Nodejs-Express

1. Password Hashing Using Bcrypt

  • Using Bcrypt Module
  • Using Bcrptjs Module

2. Password Hashing Using Scrypt

3. Password Hashing Using SHA512

--

--