Decrypt ChaCha20-Poly1305 ciphertext, preferring WebCrypto when available.
Expects format: base64(nonce (12B) || ciphertext || tag (16B)).
const result = await modernChaCha20Decrypt({ key: "a".repeat(64), ciphertext: encrypted.ciphertext,});console.log(Buffer.from(result.plaintext).toString("utf8")); Copy
const result = await modernChaCha20Decrypt({ key: "a".repeat(64), ciphertext: encrypted.ciphertext,});console.log(Buffer.from(result.plaintext).toString("utf8"));
Decrypt ChaCha20-Poly1305 ciphertext, preferring WebCrypto when available.
Expects format: base64(nonce (12B) || ciphertext || tag (16B)).