Zero-dependency end-to-end cryptography suite for the modern web.
AES-256-GCM symmetric encryption, RSA-4096 hybrid asymmetric encryption, ECDH key agreement, digital signatures, JWE compact serialization (RFC 7516), and WebRTC insertable streams — built natively for browser and Node.js Web Crypto API environments.
- 🚀 Try WebCrypt Live Playground: Test AES-256, RSA-4096, ECDH, digital signatures, and file encryption directly in your browser.
- 📚 Documentation Index
npm install webcryptimport { WebCrypt } from "webcrypt";
const wc = new WebCrypt();
const encrypted = await wc.encryptText("Secret message", "my-password");
const decrypted = await wc.decryptText(encrypted, "my-password");const { blob, filename } = await wc.encryptFile(file, "my-password", { parallelChunks: 4 });
const decrypted = await wc.decryptFile(blob, "my-password");import { WebCryptAsym } from "webcrypt";
const wca = new WebCryptAsym();
const keys = await wca.generateKeyPair(4096);
const encrypted = await wca.encryptText("Secret payload", keys.publicKey);
const decrypted = await wca.decryptText(encrypted, keys.privateKey);const aliceKeys = await wca.generateECDHKeyPair("P-256");
const bobKeys = await wca.generateECDHKeyPair("P-256");
const encrypted = await wca.encryptWithECDH("Confidential data", bobKeys.publicKey);
const decrypted = await wca.decryptWithECDH(encrypted, bobKeys.privateKey, aliceKeys.publicKey);const signingKeys = await wca.generateSigningKeyPair("ECDSA", "P-256");
const signature = await wca.signText("Tamper-proof payload", signingKeys.privateKey);
const isValid = await wca.verifyText("Tamper-proof payload", signature, signingKeys.publicKey);For complete method signatures, options, and advanced usage, see our detailed documentation sub-documents:
- 📖 Symmetric Encryption API (
WebCrypt) — AES-256-GCM, File Streaming, WebRTC E2EE, LRU Key Cache, HMAC. - 📖 Asymmetric Encryption API (
WebCryptAsym) — RSA-4096 Hybrid, ECDH, Signatures, JWE RFC 7516, HKDF. - 🔒 Cryptographic Architecture & Security — Threat Model, Timing-Safe Helpers, Grover Quantum Resistance.
- ⚛️ Post-Quantum Cryptography Guide — Kyber/Dilithium stubs & liboqs-js migration path.
- 🛡️ Security Policy — Vulnerability reporting and version support table.
MIT © PuterVision LLC