You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API follows @noble/ciphers's API for ease of use, you can check their examples as well.
Supported ciphers
aes-256-gcm
Both 16 bytes and 12 bytes nonce are supported.
aes-256-cbc
Only for legacy applications. You should use xchacha20-poly1305 or aes-256-gcm as possible.
Nonce is always 16 bytes.
chacha20-poly1305
Nonce is always 12 bytes.
xchacha20-poly1305
Nonce is always 24 bytes.
If key is fixed and nonce is less than 16 bytes, avoid randomly generated nonce.
Known limitations
xchacha20-poly1305 is implemented with pure JS hchacha20 function and node:crypto's chacha20-poly1305 on node.
Currently (Nov 2025), node:crypto's chacha20-poly1305 is neither supported on deno nor bun, @noble/ciphers's implementation is used on both platforms instead.
Some old versions of denodid not supportindirect conditional exports. If you used this library to build another library, client code of your library might have fell back to the node:crypto implementation and would not work properly, specifically aes-256-gcm (16 bytes nonce) and chacha20-poly1305. If you found such a problem, upgrade deno and run with --conditions deno (>=2.4.0) or --unstable-node-conditions deno(>=2.3.6,<2.4.0).