Skip to content
Cloudflare Docs

crypto

To enable built-in Node.js APIs and polyfills, add the nodejs_compat compatibility flag to your Wrangler configuration file. This also enables nodejs_compat_v2 as long as your compatibility date is 2024-09-23 or later. Learn more about the Node.js compatibility flag and v2.

The node:crypto module provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions.

All node:crypto APIs are fully supported in Workers with the following exceptions:

The full node:crypto API is documented in the Node.js documentation for node:crypto โ†—.

The WebCrypto API is also available within Cloudflare Workers. This does not require the nodejs_compat compatibility flag.