Documentation
WebBuf is a family of 29 npm packages providing a common buffer format and high-performance cryptography, written in Rust and compiled to WebAssembly. The WASM is inlined as base64, so every package loads synchronously with no async imports or top-level await. Each package page below documents its full public API, generated directly from the published type signatures.
Quick start
Install the umbrella package to get the core utilities:
npm install webbuf Core buffers
Hashing & KDF
Elliptic curve
Symmetric ciphers
Authenticated encryption
Diffie-Hellman encryption
@webbuf/acb3dh
AES+CBC encryption/decryption with blake3 mac and secp256k1 Diffie-Hellman shared secret
@webbuf/acb3p256dh
AES+CBC encryption/decryption with blake3 mac and P-256 (NIST) Diffie-Hellman shared secret
@webbuf/acs2dh
AES+CBC encryption/decryption with SHA-256 HMAC and secp256k1 Diffie-Hellman shared secret
@webbuf/acs2p256dh
AES+CBC encryption/decryption with SHA-256 HMAC and P-256 (NIST) Diffie-Hellman shared secret
@webbuf/aesgcm-p256dh
AES-GCM authenticated encryption with P-256 (NIST) Diffie-Hellman shared secret
Post-quantum primitives
Hybrid post-quantum
@webbuf/aesgcm-mlkem
AES-256-GCM with ML-KEM-768 key encapsulation: post-quantum authenticated encryption
@webbuf/aesgcm-p256dh-mlkem
Hybrid AES-256-GCM with P-256 ECDH + ML-KEM-768: classical + post-quantum authenticated encryption
@webbuf/aesgcm-x25519dh-mlkem
Hybrid AES-256-GCM with X25519 ECDH + ML-KEM-768: classical + post-quantum authenticated encryption (Curve25519-flavored sibling of @webbuf/aesgcm-p256dh-mlkem)
@webbuf/sig-ed25519-mldsa
Composite Ed25519 + ML-DSA-65 signatures (OpenPGP-style hybrid: classical + post-quantum)