-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
509 lines (464 loc) · 30.9 KB
/
Copy pathindex.html
File metadata and controls
509 lines (464 loc) · 30.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebCrypt — Zero-Dependency AES-256-GCM & RSA Cryptography Suite</title>
<meta name="description" content="Zero-dependency JavaScript AES-256-GCM encryption library for text, files & WebRTC E2EE. Pure Web Crypto API with OWASP-compliant PBKDF2 (600,000 iterations). Native for browser and Node.js Web Crypto environments.">
<meta name="keywords" content="webcrypt, aes-256-gcm, cryptography, web crypto api, zero dependency, rsa-4096, hybrid encryption, e2ee, webrtc, browser encryption, post-quantum">
<meta name="author" content="PuterVision (https://putervision.com)">
<meta name="theme-color" content="#0b0f19">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="glow-backdrop"></div>
<header>
<div class="logo">
<a href="https://putervision.com" target="_blank" rel="noopener noreferrer" class="brand-link"><img src="putervision-icon.png" alt="PuterVision Icon" class="nav-brand-img"> PuterVision</a>
<span class="logo-sep">/</span>
<a href="https://github.com/putervision/webcrypt" class="logo-link"><img src="webcrypt-icon.png" alt="WebCrypt Icon" class="nav-brand-img"><span class="logo-text">WebCrypt</span></a>
</div>
<nav aria-label="Main Navigation">
<ul class="nav-links">
<li><a href="#tools">Live Tools</a></li>
<li><a href="#mcp">AI Agent MCP</a></li>
<li><a href="#features">Features</a></li>
<li><a href="#quickstart">Quickstart</a></li>
<li><a href="#security">Security & Legal</a></li>
<li><a href="#api">API Reference</a></li>
</ul>
</nav>
<a href="https://github.com/putervision/webcrypt" class="btn-github" target="_blank" rel="noopener noreferrer" aria-label="Star on GitHub">
<svg height="16" width="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" role="img" style="color: #fbbf24">
<path d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"></path>
</svg>
Star on
<svg height="18" width="18" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" role="img">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>
</svg>
</a>
</header>
<main class="container">
<!-- Hero Section -->
<section class="hero">
<span class="badge">RELEASE v1.0.1 • AI AGENT MCP TOOLING • ZERO DEPENDENCIES • PURE WEB CRYPTO API</span>
<h1>Zero-Dependency Web Cryptography & AI Agent Tooling Suite</h1>
<p>High-performance AES-256-GCM encryption, RSA-4096 hybrid public keys, post-quantum KEM, and native Model Context Protocol (MCP) server for autonomous AI coding agents.</p>
<div class="cta-group">
<a href="#tools" class="btn-primary">Try Live Tools</a>
<a href="#mcp" class="btn-secondary">AI Agent MCP</a>
<a href="#quickstart" class="btn-secondary">Code Quickstart</a>
<a href="#features" class="btn-secondary">Explore Features</a>
</div>
</section>
<!-- Key Features Grid -->
<section id="features" class="features-grid">
<div class="feature-card">
<div class="feature-icon">🤖</div>
<h3>AI Agent MCP Server</h3>
<p>Built-in stdio Model Context Protocol (MCP) server equipping AI coding agents with zero-config cryptographic vaults.</p>
</div>
<div class="feature-card">
<div class="feature-icon">🔒</div>
<h3>AES-256-GCM Encryption</h3>
<p>Authenticated symmetric encryption with unique 128-bit salt and 96-bit IV per payload for max integrity and secrecy.</p>
</div>
<div class="feature-card">
<div class="feature-icon">🔑</div>
<h3>RSA-4096 Hybrid Mode</h3>
<p>Asymmetric public-key encryption combining RSA-OAEP key wrapping with high-speed AES-256-GCM payload encryption.</p>
</div>
<div class="feature-card">
<div class="feature-icon">🧠</div>
<h3>PuterVision Triad Standard</h3>
<p>Seamlessly integrates with <code>state-memory-mcp</code> (workflow DAG) and <code>vision-memory-mcp</code> (visual cache).</p>
</div>
<div class="feature-card">
<div class="feature-icon">📡</div>
<h3>WebRTC E2EE Streams</h3>
<p>Real-time video/audio media frame encryption using WebRTC Insertable Streams and transform streams.</p>
</div>
<div class="feature-card">
<div class="feature-icon">⚡</div>
<h3>Zero Dependencies</h3>
<p>100% native Web Crypto API (`globalThis.crypto.subtle`) execution across browsers and Node.js 18+.</p>
</div>
</section>
<!-- Live Cryptography Workbench Section -->
<section id="tools" class="card">
<div class="section-title">
<span class="badge">Interactive Browser Workbench</span>
<h2>Live Web Cryptography Tools</h2>
</div>
<nav class="tool-nav" aria-label="Cryptography Tools Navigation">
<button class="tool-tab-btn active" data-tab="tab-sym" id="tab-sym-btn">🔒 AES-256-GCM</button>
<button class="tool-tab-btn" data-tab="tab-asym" id="tab-asym-btn">🔑 RSA-4096 Hybrid</button>
<button class="tool-tab-btn" data-tab="tab-pass" id="tab-pass-btn">🎲 Key Generator</button>
<button class="tool-tab-btn" data-tab="tab-hmac" id="tab-hmac-btn">🛡️ HMAC Authentication</button>
<button class="tool-tab-btn" data-tab="tab-inspect" id="tab-inspect-btn">🧪 Environment Inspector</button>
</nav>
<!-- 1. Symmetric Tab -->
<div id="tab-sym" class="tool-tab-content active">
<div class="demo-grid">
<div>
<div class="form-group">
<label for="sym-input">Message Payload to Encrypt</label>
<textarea id="sym-input" class="form-control tool-textarea" placeholder="Enter confidential message or JSON data...">Confidential payload: The key to victory is zero dependencies.</textarea>
</div>
<div class="form-group">
<label for="sym-pass">Encryption Password</label>
<input type="password" id="sym-pass" class="form-control" value="WebCryptSecret2026!">
</div>
<div class="tool-btn-group">
<button id="btn-sym-encrypt" class="btn-primary" style="padding: 0.6rem 1.25rem; font-size: 0.9rem;">🔒 Encrypt Payload</button>
<button id="btn-sym-decrypt" class="btn-secondary" style="padding: 0.6rem 1.25rem; font-size: 0.9rem;">🔓 Decrypt Payload</button>
</div>
</div>
<div>
<div class="form-group flex-fill">
<label for="sym-output">Base64 Output (Salt + IV + AES-GCM Ciphertext)</label>
<textarea id="sym-output" class="form-control tool-textarea" readonly placeholder="Encrypted Base64 output will appear here..."></textarea>
</div>
<div id="sym-stats" class="stats-badge success">Ready for zero-dependency AES-256-GCM execution</div>
</div>
</div>
</div>
<!-- 2. Asymmetric Tab -->
<div id="tab-asym" class="tool-tab-content">
<div style="margin-bottom: 1.25rem;" class="tool-btn-group">
<label style="font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 0.5rem;">
Modulus Size:
<select id="asym-modulus" class="form-control" style="width: auto; padding: 0.35rem 0.65rem;">
<option value="4096" selected>RSA-4096 (Maximum Security)</option>
<option value="2048">RSA-2048 (Fast)</option>
</select>
</label>
<button id="btn-asym-genkeys" class="btn-primary" style="padding: 0.5rem 1.2rem; font-size: 0.88rem;">⚡ Generate RSA Key Pair</button>
</div>
<div class="demo-grid" style="margin-bottom: 1rem;">
<div>
<label for="asym-pubkey" style="font-size: 0.85rem; font-weight: 600; color: var(--accent-cyan); display: block; margin-bottom: 0.3rem;">Public Key (SPKI Base64)</label>
<textarea id="asym-pubkey" class="form-control tool-textarea" readonly style="min-height: 80px;" placeholder="Click 'Generate Key Pair' above..."></textarea>
</div>
<div>
<label for="asym-privkey" style="font-size: 0.85rem; font-weight: 600; color: var(--accent-indigo); display: block; margin-bottom: 0.3rem;">Private Key (PKCS8 Base64)</label>
<textarea id="asym-privkey" class="form-control tool-textarea" readonly style="min-height: 80px;" placeholder="Click 'Generate Key Pair' above..."></textarea>
</div>
</div>
<div class="demo-grid">
<div>
<div class="form-group">
<label for="asym-input">Secret Message</label>
<textarea id="asym-input" class="form-control tool-textarea" style="min-height: 70px;">Asymmetric Top Secret Briefing</textarea>
</div>
<div class="tool-btn-group">
<button id="btn-asym-encrypt" class="btn-primary" style="padding: 0.5rem 1.1rem; font-size: 0.88rem;">🔒 RSA Hybrid Encrypt</button>
<button id="btn-asym-decrypt" class="btn-secondary" style="padding: 0.5rem 1.1rem; font-size: 0.88rem;">🔓 RSA Hybrid Decrypt</button>
</div>
</div>
<div>
<div class="form-group flex-fill">
<label for="asym-output">Encrypted Payload</label>
<textarea id="asym-output" class="form-control tool-textarea" readonly style="min-height: 70px;" placeholder="Encrypted RSA hybrid payload..."></textarea>
</div>
<div id="asym-stats" class="stats-badge pending">Generate a key pair to begin asymmetric testing</div>
</div>
</div>
</div>
<!-- 3. Password Generator Tab -->
<div id="tab-pass" class="tool-tab-content">
<div style="max-width: 650px; margin: 0 auto;">
<div class="form-group">
<label for="pass-len-slider">Secret Entropy Bytes: <span id="pass-len-val" style="color: var(--accent-cyan);">32 bytes</span></label>
<input type="range" id="pass-len-slider" min="16" max="128" value="32" style="width: 100%; accent-color: var(--accent-cyan);">
</div>
<div class="form-group">
<label for="pass-format">Encoding Output Format</label>
<select id="pass-format" class="form-control">
<option value="hex" selected>Hexadecimal String (64 chars = 256 bits)</option>
<option value="base64">Base64 Encoded String</option>
<option value="ascii">Printable ASCII Special Set</option>
</select>
</div>
<button id="btn-gen-pass" class="btn-primary" style="width: 100%; margin-bottom: 1rem;">🎲 Generate Cryptographic Key / Password</button>
<div class="form-group">
<label for="pass-output">Generated High-Entropy Key String</label>
<input type="text" id="pass-output" class="form-control" readonly style="font-family: 'Fira Code', monospace; color: var(--accent-cyan);" placeholder="Click Generate above...">
</div>
<div id="pass-entropy-badge" class="stats-badge success">256 Bits Cryptographic Entropy</div>
</div>
</div>
<!-- 4. HMAC Tab -->
<div id="tab-hmac" class="tool-tab-content">
<div class="demo-grid">
<div>
<div class="form-group">
<label for="hmac-msg">Data to Authenticate</label>
<textarea id="hmac-msg" class="form-control tool-textarea">Transaction ID #948201 - Amount: $500,000</textarea>
</div>
<div class="form-group">
<label for="hmac-secret">Shared HMAC Secret Key</label>
<input type="password" id="hmac-secret" class="form-control" value="SharedSecretHmacKey2026!">
</div>
<div class="form-group">
<label for="hmac-hash">Hash Algorithm</label>
<select id="hmac-hash" class="form-control">
<option value="SHA-256" selected>HMAC-SHA-256 (Standard)</option>
<option value="SHA-384">HMAC-SHA-384 (High)</option>
<option value="SHA-512">HMAC-SHA-512 (Ultra)</option>
</select>
</div>
<div class="tool-btn-group">
<button id="btn-hmac-sign" class="btn-primary" style="padding: 0.5rem 1.1rem; font-size: 0.88rem;">🛡️ Compute HMAC Tag</button>
<button id="btn-hmac-verify" class="btn-secondary" style="padding: 0.5rem 1.1rem; font-size: 0.88rem;">✅ Verify Tag</button>
</div>
</div>
<div>
<div class="form-group flex-fill">
<label for="hmac-tag">Base64 HMAC Signature Tag</label>
<textarea id="hmac-tag" class="form-control tool-textarea" readonly placeholder="HMAC signature tag will appear here..."></textarea>
</div>
<div id="hmac-stats" class="stats-badge success">Ready for HMAC authentication</div>
</div>
</div>
</div>
<!-- 5. Inspector Tab -->
<div id="tab-inspect" class="tool-tab-content">
<p style="color: var(--text-secondary); margin-bottom: 1.25rem;">Live inspection of your current browser runtime environment (`globalThis.crypto.subtle` capabilities and native Web Crypto features):</p>
<div id="inspector-results"></div>
</div>
</section>
<!-- AI Agent Tooling (MCP) Section -->
<section id="mcp" class="card">
<div class="section-title">
<span class="badge">Model Context Protocol (MCP)</span>
<h2>Native AI Agent Tooling & Multi-IDE Integration</h2>
</div>
<p style="color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.6;">
WebCrypt includes a built-in, zero-dependency <strong>Model Context Protocol (MCP)</strong> stdio server that equips AI coding agents (Antigravity, Claude, Cursor, Copilot, Windsurf, Cline) with cryptographic vaults, digital signatures, and key management tools.
</p>
<div style="background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.25rem; margin-bottom: 1.5rem;">
<h3 style="color: var(--accent-cyan); margin-bottom: 0.5rem; font-size: 1.1rem;">⚡ Quick Auto-Setup (Zero Manual Configuration)</h3>
<p style="color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 0.75rem;">Run inside any project to automatically scaffold IDE MCP configurations, agent skills, and rules:</p>
<div class="code-box" style="margin: 0; padding: 0.75rem 1rem;">
<span class="cm"># Install globally and initialize your project</span>
npm install -g webcrypt
webcrypt init
<span class="cm"># Verify environment and configuration health</span>
webcrypt doctor
</div>
</div>
<h3 style="color: var(--accent-cyan); margin-bottom: 0.75rem;">Why AI Agents Need WebCrypt MCP</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem;">
<div style="background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 1rem;">
<strong style="color: var(--accent-cyan); display: block; margin-bottom: 0.3rem;">🔐 Confidential Local Vault</strong>
<span style="font-size: 0.86rem; color: var(--text-secondary); line-height: 1.4; display: block;">Encrypts API keys, secrets, and task memory before disk writes to prevent prompt log leaks.</span>
</div>
<div style="background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 1rem;">
<strong style="color: var(--accent-indigo); display: block; margin-bottom: 0.3rem;">🛡️ Tamper-Proof Signing</strong>
<span style="font-size: 0.86rem; color: var(--text-secondary); line-height: 1.4; display: block;">Computes cryptographic ECDSA/HMAC signatures on build artifacts and test evidence packs.</span>
</div>
<div style="background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 1rem;">
<strong style="color: var(--accent-emerald); display: block; margin-bottom: 0.3rem;">🤝 Inter-Agent Key Exchange</strong>
<span style="font-size: 0.86rem; color: var(--text-secondary); line-height: 1.4; display: block;">Generates ephemeral JWK keypairs (RSA-4096 / ECDH) for private subagent communication.</span>
</div>
<div style="background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 1rem;">
<strong style="color: #fbbf24; display: block; margin-bottom: 0.3rem;">🧠 PuterVision Triad Standard</strong>
<span style="font-size: 0.86rem; color: var(--text-secondary); line-height: 1.4; display: block;">Seamless security layer for <code>state-memory-mcp</code> (workflow DAG) and <code>vision-memory-mcp</code> (visual cache).</span>
</div>
</div>
<h3 style="color: var(--accent-indigo); margin-bottom: 0.75rem;">Registered MCP Tools for AI Agents</h3>
<div style="overflow-x: auto; margin-bottom: 1.5rem;">
<table style="width: 100%; border-collapse: collapse; color: var(--text-primary); text-align: left; font-size: 0.9rem;">
<thead>
<tr style="border-bottom: 2px solid var(--border-color); color: var(--accent-cyan);">
<th style="padding: 0.6rem;">Tool Name</th>
<th style="padding: 0.6rem;">Action / Mode</th>
<th style="padding: 0.6rem;">Description</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.6rem; font-weight: 600;">`encrypt_payload`</td>
<td style="padding: 0.6rem;">symmetric | asymmetric | data</td>
<td style="padding: 0.6rem;">Encrypts strings, JSON objects, or files with AES-256-GCM or RSA-4096.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.6rem; font-weight: 600;">`decrypt_payload`</td>
<td style="padding: 0.6rem;">symmetric | asymmetric | data</td>
<td style="padding: 0.6rem;">Decrypts ciphertext produced by WebCrypt back to plaintext or structured JSON.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.6rem; font-weight: 600;">`manage_keys`</td>
<td style="padding: 0.6rem;">generate (rsa, ecdh, hmac, password)</td>
<td style="padding: 0.6rem;">Generates JWK keypairs (RSA-4096, ECDH P-256/P-384) or high-entropy passwords.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.6rem; font-weight: 600;">`crypto_hash`</td>
<td style="padding: 0.6rem;">SHA-256 | SHA-512 | SHA-3</td>
<td style="padding: 0.6rem;">Computes cryptographic hash digests in hex or base64.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.6rem; font-weight: 600;">`sign_verify`</td>
<td style="padding: 0.6rem;">sign | verify (ECDSA, HMAC)</td>
<td style="padding: 0.6rem;">Signs and verifies messages, release hashes, and evidence packs.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.6rem; font-weight: 600;">`pqc_kem_sign`</td>
<td style="padding: 0.6rem;">Kyber KEM | Dilithium | Hybrid</td>
<td style="padding: 0.6rem;">Post-quantum key encapsulation and lattice signatures.</td>
</tr>
</tbody>
</table>
</div>
<div style="text-align: center; margin-top: 1rem;">
<a href="https://github.com/putervision/webcrypt/blob/main/docs/MCP_IDE_SETUP.md" target="_blank" rel="noopener noreferrer" class="btn-primary" style="display: inline-block; padding: 0.6rem 1.4rem;">📖 Read Complete Multi-IDE Setup Guide</a>
</div>
</section>
<!-- Code Quickstart Section -->
<section id="quickstart" class="card">
<div class="section-title">
<span class="badge">Code Quickstart & Examples</span>
<h2>Comprehensive Suite Examples</h2>
</div>
<h3 style="color: var(--accent-cyan); margin-bottom: 0.5rem;">1. Symmetric AES-256-GCM Text & Data</h3>
<div class="code-box">
<span class="kw">import</span> { WebCrypt } <span class="kw">from</span> <span class="str">"webcrypt"</span>;
<span class="kw">const</span> crypt = <span class="kw">new</span> <span class="fn">WebCrypt</span>();
<span class="cm">// Encrypt text with password (OWASP 600k PBKDF2 + AES-256-GCM)</span>
<span class="kw">const</span> encryptedB64 = <span class="kw">await</span> crypt.<span class="fn">encryptText</span>(
<span class="str">"Confidential data payload"</span>,
<span class="str">"StrongUserPassword123!"</span>
);
<span class="cm">// Decrypt text back to plaintext</span>
<span class="kw">const</span> decryptedText = <span class="kw">await</span> crypt.<span class="fn">decryptText</span>(
encryptedB64,
<span class="str">"StrongUserPassword123!"</span>
);
console.<span class="fn">log</span>(decryptedText); <span class="cm">// "Confidential data payload"</span>
</div>
<h3 style="color: var(--accent-indigo); margin-top: 1.5rem; margin-bottom: 0.5rem;">2. Asymmetric RSA-4096 Hybrid Public Key Encryption</h3>
<div class="code-box">
<span class="kw">import</span> { WebCryptAsym } <span class="kw">from</span> <span class="str">"webcrypt/webcrypt-asym"</span>;
<span class="kw">const</span> asym = <span class="kw">new</span> <span class="fn">WebCryptAsym</span>();
<span class="kw">const</span> keys = <span class="kw">await</span> asym.<span class="fn">generateKeyPair</span>();
<span class="cm">// Encrypt text with public key</span>
<span class="kw">const</span> encrypted = <span class="kw">await</span> asym.<span class="fn">encryptText</span>(<span class="str">"Top Secret Document"</span>, keys.publicKey);
<span class="cm">// Decrypt text with private key</span>
<span class="kw">const</span> decrypted = <span class="kw">await</span> asym.<span class="fn">decryptText</span>(encrypted, keys.privateKey);
</div>
<h3 style="color: var(--accent-emerald); margin-top: 1.5rem; margin-bottom: 0.5rem;">3. Deterministic HMAC Authentication (SHA-256 / SHA-3)</h3>
<div class="code-box">
<span class="cm">// Generate HMAC key from password</span>
<span class="kw">const</span> key = <span class="kw">await</span> crypt.<span class="fn">generateHmacKey</span>(<span class="str">"my-secret-password"</span>, <span class="str">"SHA-256"</span>);
<span class="cm">// Compute signature tag</span>
<span class="kw">const</span> tag = <span class="kw">await</span> crypt.<span class="fn">computeHmac</span>(<span class="str">"Message to sign"</span>, key);
<span class="cm">// Verify signature</span>
<span class="kw">const</span> isValid = <span class="kw">await</span> crypt.<span class="fn">verifyHmac</span>(<span class="str">"Message to sign"</span>, tag, key);
</div>
</section>
<!-- API Reference Grid Section -->
<section id="api" class="card">
<div class="section-title">
<span class="badge">Complete API Reference</span>
<h2>Exported Modules & Signatures</h2>
</div>
<div style="overflow-x: auto;">
<table style="width: 100%; border-collapse: collapse; margin-top: 1rem; color: var(--text-primary); text-align: left;">
<thead>
<tr style="border-bottom: 2px solid var(--border-color); color: var(--accent-cyan);">
<th style="padding: 0.75rem;">Module</th>
<th style="padding: 0.75rem;">Method</th>
<th style="padding: 0.75rem;">Description</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCrypt`</td>
<td style="padding: 0.75rem;">`encryptText(text, password)`</td>
<td style="padding: 0.75rem;">AES-256-GCM text encryption returning Base64 salt+iv+ciphertext.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCrypt`</td>
<td style="padding: 0.75rem;">`decryptText(b64, password)`</td>
<td style="padding: 0.75rem;">Decrypts Base64 string back to plain text.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCrypt`</td>
<td style="padding: 0.75rem;">`encryptFile(file, password, options)`</td>
<td style="padding: 0.75rem;">Streaming file encryption returning encrypted Blob (parallelChunks support).</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCrypt`</td>
<td style="padding: 0.75rem;">`createEncryptTransform(password)`</td>
<td style="padding: 0.75rem;">WebRTC Insertable Streams E2EE media frame encryption transform.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCrypt`</td>
<td style="padding: 0.75rem;">`generateHmacKeySHA3(pass, hash, salt, iter)`</td>
<td style="padding: 0.75rem;">Derives iterative SHA-3 HMAC key.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCryptAsym`</td>
<td style="padding: 0.75rem;">`generateKeyPair(modulusLength)`</td>
<td style="padding: 0.75rem;">Generates 4096-bit RSA-OAEP key pair.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCryptAsym`</td>
<td style="padding: 0.75rem;">`encryptWithECDH(text, senderPrivateKey, recipientPublicKey)`</td>
<td style="padding: 0.75rem;">One-step ECDH public-key encryption.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCryptAsym`</td>
<td style="padding: 0.75rem;">`signText(text, privateKey)`</td>
<td style="padding: 0.75rem;">Digital signature creation using ECDSA P-256 or P-384.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCryptAsym`</td>
<td style="padding: 0.75rem;">`encryptJWE(payload, publicKey)`</td>
<td style="padding: 0.75rem;">RFC 7516 5-part JWE Compact Serialization.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCryptAsym`</td>
<td style="padding: 0.75rem;">`deriveChildKeyHierarchical(parentKey, salt)`</td>
<td style="padding: 0.75rem;">Hierarchical key derivation from parent key.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`WebCryptPQC`</td>
<td style="padding: 0.75rem;">`kyberEncapsulate() / dilithiumSign()`</td>
<td style="padding: 0.75rem;">NIST Post-Quantum Cryptography key exchange & signatures.</td>
</tr>
<tr style="border-bottom: 1px solid var(--border-color);">
<td style="padding: 0.75rem; font-weight: 600;">`TimingSafeHelper`</td>
<td style="padding: 0.75rem;">`constantTimeCompareBuffers(a, b)`</td>
<td style="padding: 0.75rem;">Constant-time buffer comparison preventing timing oracles.</td>
</tr>
</tbody>
</table>
</div>
</section>
<!-- Environment & Legal Section -->
<section id="security" class="card">
<div class="section-title">
<span class="badge">Security & Legal Policy</span>
<h2>Limitation of Liability & License</h2>
</div>
<p style="text-align: center; color: var(--text-secondary); max-width: 750px; margin: 0 auto 1.5rem;">
WebCrypt is maintained by <a href="https://putervision.com" target="_blank" rel="noopener noreferrer" style="color: var(--accent-cyan); text-decoration: underline;">PuterVision</a> and released under the MIT License.
</p>
<div style="background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 12px; padding: 1.25rem; font-size: 0.88rem; color: #fca5a5; line-height: 1.6;">
<strong style="color: #f87171; display: block; margin-bottom: 0.5rem; font-size: 0.95rem;">DISCLAIMER OF WARRANTY & LIMITATION OF LIABILITY</strong>
WEBCRYPT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL PUTERVISION LLC, ITS AFFILIATES, OR CONTRIBUTORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</div>
</section>
<footer>
<p>© 2025-2026 <a href="https://putervision.com" target="_blank" rel="noopener noreferrer">PuterVision</a>. Released under the MIT License.</p>
<p style="margin-top: 0.5rem; font-size: 0.82rem;">Pure Web Crypto API • Zero Dependencies • Local Execution • Maintained by <a href="https://putervision.com" target="_blank" rel="noopener noreferrer">PuterVision</a></p>
</footer>
</main>
<script src="app.js"></script>
</body>
</html>