Documentation
WebBuf is a family of 33 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 webbufCore buffers
Hashing & KDF
@webbuf/blake3
Rust/wasm optimized blake3 hash & mac
@webbuf/sha256
Rust/wasm optimized SHA-256 hash & HMAC-SHA256
@webbuf/sha1
Synchronous Rust/WASM SHA-1 for legacy protocol interoperability.
@webbuf/ripemd160
Rust/wasm optimized ripemd160 hash & mac
@webbuf/pbkdf2-sha256
Rust/wasm optimized PBKDF2-HMAC-SHA256 password-based key derivation
@webbuf/hkdf-sha256
Synchronous HKDF-SHA-256 extract, expand and key derivation for browsers and JavaScript runtimes.
Elliptic curve
@webbuf/rfc6979
RFC6979 HMAC-SHA256 deterministic nonces using existing WebBuf primitives.
@webbuf/secp256k1
Rust/wasm optimized secp256k1 ecdsa and Diffie-Hellman
@webbuf/bch-schnorr
BCH Schnorr signatures using hash-free k256 WASM and existing SHA256 primitives.
@webbuf/p256
Rust/wasm optimized P-256 (NIST) ECDSA and Diffie-Hellman
@webbuf/x25519
Rust/wasm X25519 ECDH (RFC 7748)
@webbuf/ed25519
Rust/wasm Ed25519 PureEdDSA (RFC 8032)
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)