What is the difference between crypto and bcrypt

These modules are required as

const crypto = require('crypto');
const bcrypt = require('bcrypt');

I am very confused between them. I want to know what the difference is between them and when it should be used.

+4
source share
1 answer

The bcrypt module contains an implementation of the bcrypt password hashing algorithm and nothing else.

The built-in crypto module contains many cryptographic primitives, such as hashing, symmetric and asymmetric encryption, key exchange, and some others. It does not contain a bcrypt implementation, but there is a PBKDF2 implementation that has a similar purpose (password hashing), but not as good as bcrypt.

+5
source

Source: https://habr.com/ru/post/1674691/


All Articles