Package Exports
- @hazae41/chacha20
Readme
ChaCha20
ChaCha20 for the web
npm install @hazae41/chacha20Features
Current features
- 100% TypeScript and ESM
- No external dependencies
Usage
const key = crypto.getRandomValues(new Uint8Array(32))
const nonce = crypto.getRandomValues(new Uint8Array(12))
const encryptor = chacha20.Cipher.import(key, nonce)
const decryptor = chacha20.Cipher.import(key, nonce)
const message = new TextEncoder().encode("Hello world")
const encrypted = encryptor.feed(message)
const decrypted = decryptor.feed(encrypted)