xchaos
v1.0.48
Published
High-speed stream cipher with WebAssembly
Maintainers
Readme
XChaOS (Pure JS)
XChaOS is a fast, modern ARX stream cipher implemented in Wasm. It uses a 1024-bit internal state and produces 128-byte blocks with high performance and simplicity.
Features
- 256-bit key / 128-bit nonce
- Wasm compiled
- Secure ARX-based operations (Add-Rotate-XOR)
- ChaCha-inspired design with dynamic rotations and lane shuffles
Usage
import { encrypt, decrypt, keystream } from 'xchaos';
const key = Buffer.alloc(32, 1); // 256-bit
const nonce = Buffer.alloc(16, 2); // 128-bit
const message = Buffer.from("Secret");
const encrypted = encrypt(key, nonce, message);
const decrypted = decrypt(key, nonce, encrypted);
console.log(decrypted.toString()); // "Secret"Installation
npm install xchaos