node:crypto

The built-in Node.js module for hashing, HMACs, encryption, random numbers and key derivation, backed by OpenSSL.

In more detail

Import it with import { createHash } from "node:crypto". Slow functions such as pbkdf2 and scrypt have asynchronous versions that run on libuv's thread pool, and Sync versions that block the main thread.

Related terms

Taught in

References