Egg password encryption

For security, no user private data is stored in the database in plain text. This article describes how to use the MD5 algorithm to encrypt user passwords under the Egg project.

1. Install the utility module with MD5 encryption function

npm install utility --save

2. Introduce modules where needed

const utility = require('utility')

3. Test the effect of MD5 encryption

1. Before encryption


2. After encryption

4. Commonly used encryption modules include crypto-js

Guess you like

Origin blog.csdn.net/qq_41548644/article/details/117406794