node:crypto provides Node’s hashing, cipher, key, signature, key-agreement, derivation, and random APIs.
Key generation includes ML-DSA and ML-KEM; webcrypto is the same object as globalThis.crypto.
Differences from Node
process.versions.opensslis1.1.1andprocess.features.openssl_is_boringsslistrue.- Errors use BoringSSL-style strings (
error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT) andERR_OSSL_*codes.
Not available
X509CertificateandCertificateare not exported.- Ed448 and X448 throw
ERR_CRYPTO_UNSUPPORTED_OPERATION; OCB ciphers are absent. argon2andargon2SyncthrowERR_CRYPTO_ARGON2_NOT_SUPPORTED.setFipsthrowsERR_CRYPTO_FIPS_UNAVAILABLE;getFips()returns0.setEnginethrowsERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED.