@hazae41/chacha20poly1305
v2.0.10
Published
ChaCha20Poly1305 for the web
Maintainers
Readme
ChaCha20Poly1305
ChaCha20-Poly1305 for the web
npm install @hazae41/chacha20poly1305Features
Current features
- 100% TypeScript and ESM
- No external dependencies
Usage
const key = crypto.getRandomValues(new Uint8Array(32))
const cipher = chaCha20Poly1305.Cipher.import(key)
const message = new TextEncoder().encode("Hello world")
const nonce = crypto.getRandomValues(new Uint8Array(12))
const encrypted = cipher.encrypt(message, nonce)
const decrypted = cipher.decrypt(encrypted, nonce)