Encrypting passwords before storing them is a BAD idea! Hopefully you're not surprised to hear that.
Many people assume that encrypting the password before storing it is the right approach to building a secure web application. However, encrypting your passwords is a BAD IDEA and will make your application vulnerable.
Even worse, some people simply store the passwords in plain text!
In this tutorial, we’ll look at a simple example of how to securely store passwords using bcyrpt.