New:Socket for Asana Is Now Available.Learn more
Get Started

webcrypt

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webcrypt

Zero-dependency JavaScript AES-256-GCM encryption suite for text, files & WebRTC E2EE. Supports symmetric password derivation, RSA-4096 hybrid encryption, and post-quantum cryptography via pure Web Crypto API.

Source
npmnpm
Version
0.7.0
Version published
Weekly downloads
1.2K
-76.95%
Maintainers
1
Weekly downloads
 
Created
Source

WebCrypt

Zero-dependency end-to-end cryptography suite for the modern web.

npm version license tests coverage

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.

Interactive Live Demo & Documentation

Installation

npm install webcrypt

Quick Start Code Examples

1. Symmetric Text Encryption (AES-256-GCM)

import { WebCrypt } from "webcrypt";
const wc = new WebCrypt();

const encrypted = await wc.encryptText("Secret message", "my-password");
const decrypted = await wc.decryptText(encrypted, "my-password");

2. Large File Streaming Encryption (8MB Chunking)

const { blob, filename } = await wc.encryptFile(file, "my-password", { parallelChunks: 4 });
const decrypted = await wc.decryptFile(blob, "my-password");

3. Public-Key Hybrid Encryption (RSA-4096)

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);

4. ECDH Key Agreement & One-Step Encryption

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);

5. Digital Signatures (ECDSA P-256 / RSA-PSS)

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);

Complete API & Technical Documentation

For complete method signatures, options, and advanced usage, see our detailed documentation sub-documents:

License

MIT © PuterVision LLC

Keywords

encryption

FAQs

Package last updated on 04 Aug 2026

Related posts