Skip to main content

Built and signed on GitHub Actions

Audited & minimal JS implementation of Salsa20, ChaCha and AES

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
94%
Published
2 months ago (1.2.1)

Audited & minimal JS implementation of Salsa20, ChaCha and AES. Check out individual modules.

Examples

import { gcm, siv } from '@noble/ciphers/aes'; import { xsalsa20poly1305 } from '@noble/ciphers/salsa'; import { secretbox } from '@noble/ciphers/salsa'; // == xsalsa20poly1305 import { chacha20poly1305, xchacha20poly1305 } from '@noble/ciphers/chacha';

// Unauthenticated encryption: make sure to use HMAC or similar import { ctr, cfb, cbc, ecb } from '@noble/ciphers/aes'; import { salsa20, xsalsa20 } from '@noble/ciphers/salsa'; import { chacha20, xchacha20, chacha8, chacha12 } from '@noble/ciphers/chacha';

// KW import { aeskw, aeskwp } from '@noble/ciphers/aes';

// Utilities import { bytesToHex, hexToBytes, bytesToUtf8, utf8ToBytes } from '@noble/ciphers/utils'; import { managedNonce, randomBytes } from '@noble/ciphers/webcrypto'; import { poly1305 } from '@noble/ciphers/_poly1305'; import { ghash, polyval } from '@noble/ciphers/_polyval';

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@noble/ciphers

Import symbol

import * as ciphers from "@noble/ciphers";

---- OR ----

Import directly with a jsr specifier

import * as ciphers from "jsr:@noble/ciphers";

Add Package

npx jsr add @noble/ciphers

Import symbol

import * as ciphers from "@noble/ciphers";

Add Package

yarn dlx jsr add @noble/ciphers

Import symbol

import * as ciphers from "@noble/ciphers";

Add Package

pnpm dlx jsr add @noble/ciphers

Import symbol

import * as ciphers from "@noble/ciphers";

Add Package

bunx jsr add @noble/ciphers

Import symbol

import * as ciphers from "@noble/ciphers";