-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathencrypt.html
More file actions
447 lines (394 loc) · 22.9 KB
/
encrypt.html
File metadata and controls
447 lines (394 loc) · 22.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
<!--
encryptor.app - ENCRYPT TEXT
Version 2.2.0 | AES-256-GCM | Zero-Knowledge
Built by: George A. Rauscher
Company: intelligent piXel GmbH, Starnberg, Germany
GitHub: https://github.com/georgerauscher/encryptor-app
License: MIT
-->
<!DOCTYPE html>
<html lang="en" translate="no">
<head>
<!-- SECURITY META TAGS -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">
<meta name="google" content="notranslate">
<meta name="format-detection" content="telephone=no">
<meta name="mobile-web-app-capable" content="yes">
<title>Encrypt Message - AES-256-GCM | encryptor.app</title>
<meta name="description" content="Encrypt text messages with military-grade AES-256-GCM. Client-side only. Zero-knowledge. PBKDF2 key derivation. Your data never touches our servers.">
<meta name="keywords" content="encrypt text, AES-256, text encryption, secure message, encrypt online, client-side encryption, zero-knowledge">
<meta name="robots" content="noindex, nofollow, noai, noimageai">
<link rel="icon" type="image/vnd.microsoft.icon" href="./favicon.ico">
<link rel="stylesheet" href="./style.css?v=2.2.1">
</head>
<body>
<div class="grain-overlay"></div>
<nav class="nav">
<div class="nav-content">
<div class="nav-logo">
<i data-lucide="shield-check" class="nav-icon"></i>
<span>encryptor.app </span>
</div>
<div class="nav-links">
<a href="./index.html" class="nav-link">Home</a>
<a href="./encrypt.html" class="nav-link active">Encrypt Text</a>
<a href="./decrypt.html" class="nav-link">Decrypt Text</a>
<a href="./encrypt-file.html" class="nav-link">Encrypt File</a>
<a href="./decrypt-file.html" class="nav-link">Decrypt File</a>
</div>
</div>
</nav>
<main class="container">
<div class="form-container">
<div class="form-card">
<div class="form-header">
<h1>Encrypt Message</h1>
<p>Your text will be encrypted in your browser. It never touches our servers.</p>
</div>
<div id="alertContainer"></div>
<form id="encryptForm">
<div class="form-group">
<label for="plaintext" class="form-label">
<i data-lucide="file-text" style="width: 16px; height: 16px; display: inline-block; vertical-align: middle;"></i>
Message to Encrypt
</label>
<textarea
id="plaintext"
class="form-textarea"
placeholder="Enter your message here..."
rows="8"
required
></textarea>
<div style="margin-top: 0.5rem; font-size: 0.875rem; color: var(--slate-400);">
<span id="charCount">0</span> characters
</div>
</div>
<div class="form-group">
<label for="password" class="form-label">
<i data-lucide="key" style="width: 16px; height: 16px; display: inline-block; vertical-align: middle;"></i>
Password
</label>
<div class="password-group">
<input
type="password"
id="password"
class="form-input"
placeholder="Choose a strong password (min. 12 characters)"
required
minlength="12"
style="padding-right: 45px;"
>
<button type="button" class="password-toggle" id="togglePassword" aria-label="Toggle password visibility">
<i data-lucide="eye" class="password-toggle-icon" id="toggleIcon"></i>
</button>
</div>
<div class="password-strength" id="passwordStrength">
<div class="strength-label">Password Strength: <span id="strengthText">None</span></div>
<div class="strength-bar">
<div class="strength-fill" id="strengthFill" style="width: 0%;"></div>
</div>
<div id="passwordTips" style="margin-top: 0.75rem; display: none;"></div>
<div id="passwordEntropy" style="margin-top: 0.5rem; font-size: 0.8125rem; color: var(--slate-400); display: none;"></div>
</div>
</div>
<div class="form-group">
<button type="button" class="btn btn-secondary" id="generatePassword" style="width: 100%;">
<i data-lucide="wand-2" class="btn-icon"></i>
<span>Generate Strong Password</span>
</button>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary" id="encryptBtn">
<i data-lucide="lock" class="btn-icon"></i>
<span>Encrypt Message</span>
</button>
<a href="./index.html" class="btn btn-secondary">
<i data-lucide="arrow-left" class="btn-icon"></i>
<span>Back to Home</span>
</a>
</div>
</form>
<div id="resultContainer" class="hidden">
<div class="result-card">
<label class="result-label">
<i data-lucide="check-circle" style="width: 16px; height: 16px; display: inline-block; vertical-align: middle; color: var(--green-500);"></i>
Encrypted Message (ready to share)
</label>
<div class="result-output" id="encryptedOutput"></div>
<div class="form-actions" style="margin-top: var(--spacing-md);">
<button type="button" class="btn btn-success" id="copyBtn">
<i data-lucide="copy" class="btn-icon"></i>
<span>Copy to Clipboard</span>
</button>
<button type="button" class="btn btn-secondary" id="resetBtn">
<i data-lucide="refresh-cw" class="btn-icon"></i>
<span>Encrypt Another</span>
</button>
</div>
</div>
<div class="alert alert-warning" style="margin-top: var(--spacing-lg);">
<i data-lucide="info" class="alert-icon"></i>
<div>
<strong>Important:</strong> Save this password! Without it, the message cannot be decrypted.
Share the password separately from the encrypted message (phone call, different messenger, etc.).
</div>
</div>
</div>
</div>
<!-- HOW IT WORKS -->
<div class="info-card" style="margin-top: var(--spacing-xl);">
<h2 style="font-size: 1.5rem; color: var(--slate-100); margin-bottom: var(--spacing-md);">
<i data-lucide="cpu" style="width: 28px; height: 28px; display: inline-block; vertical-align: middle; margin-right: 0.5rem;"></i>
How Text Encryption Works
</h2>
<p style="color: var(--slate-300); line-height: 1.7; margin-bottom: 1.5rem; font-size: 1rem;">
Your message is encrypted entirely in your browser using the Web Crypto API. It never touches our servers.
Here's exactly what happens when you click "Encrypt Message":
</p>
<div style="display: grid; gap: 1.5rem; margin-top: 1.5rem;">
<div class="step-container">
<div class="step-number">1</div>
<div class="step-content">
<h3 class="step-title">Generate Unique Salt</h3>
<p class="step-text">
Your browser generates a random 16-byte salt using <code class="inline-code">crypto.getRandomValues()</code>.
This ensures identical messages with the same password produce different encrypted outputs.
</p>
</div>
</div>
<div class="step-container">
<div class="step-number">2</div>
<div class="step-content">
<h3 class="step-title">Derive Encryption Key</h3>
<p class="step-text">
Your password is transformed into a 256-bit encryption key using PBKDF2-SHA-256 with 100,000 iterations.
This takes about 100 milliseconds - enough to make brute-force attacks impractical, but fast enough you won't notice.
</p>
</div>
</div>
<div class="step-container">
<div class="step-number">3</div>
<div class="step-content">
<h3 class="step-title">Encrypt with AES-256-GCM</h3>
<p class="step-text">
Your message is encrypted using AES-256-GCM (Galois/Counter Mode). A random 12-byte IV (initialization vector)
is generated, and an authentication tag is computed. GCM mode provides both encryption and tamper detection.
</p>
</div>
</div>
<div class="step-container">
<div class="step-number">4</div>
<div class="step-content">
<h3 class="step-title">Output Base64-Encoded Text</h3>
<p class="step-text">
The final encrypted data (salt + IV + ciphertext + auth tag) is Base64-encoded into a text string.
Safe to copy, paste, and send via any channel - email, messenger, SMS, cloud storage.
</p>
</div>
</div>
</div>
<div style="margin-top: 2rem; padding: 1.25rem; background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 0.75rem;">
<p style="color: var(--slate-200); line-height: 1.7; margin: 0; font-size: 1rem;">
<strong style="color: var(--blue-400);">Zero-Knowledge Architecture:</strong> Your message never leaves your browser.
The encryption happens in JavaScript using the Web Crypto API. We don't see your plaintext, your password,
or your encrypted output. The server only delivers static HTML/CSS/JS - no backend processing.
</p>
</div>
</div>
<!-- TECHNICAL SPECS -->
<div class="info-card" style="margin-top: 1.5rem;">
<h2 style="font-size: 1.5rem; color: var(--slate-100); margin-bottom: var(--spacing-md);">
<i data-lucide="shield-check" style="width: 28px; height: 28px; display: inline-block; vertical-align: middle; margin-right: 0.5rem;"></i>
Technical Specifications
</h2>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.5rem;">
<div>
<div style="color: var(--slate-500); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem;">Algorithm</div>
<div style="color: var(--slate-200); font-weight: 600;">AES-256-GCM</div>
<div style="color: var(--slate-400); font-size: 0.875rem;">NIST FIPS 197</div>
</div>
<div>
<div style="color: var(--slate-500); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem;">Key Derivation</div>
<div style="color: var(--slate-200); font-weight: 600;">PBKDF2-SHA-256</div>
<div style="color: var(--slate-400); font-size: 0.875rem;">100,000 iterations</div>
</div>
<div>
<div style="color: var(--slate-500); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem;">Platform</div>
<div style="color: var(--slate-200); font-weight: 600;">Web Crypto API</div>
<div style="color: var(--slate-400); font-size: 0.875rem;">W3C Standard</div>
</div>
<div>
<div style="color: var(--slate-500); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem;">Output Format</div>
<div style="color: var(--slate-200); font-weight: 600;">Base64</div>
<div style="color: var(--slate-400); font-size: 0.875rem;">URL-safe encoding</div>
</div>
</div>
<p style="color: var(--slate-400); line-height: 1.7; margin-top: 1.5rem; font-size: 0.9375rem;">
No custom crypto. No reinvented wheels. Just battle-tested, NIST-approved algorithms implemented using browser-native APIs.
Built by <strong style="color: var(--slate-300);">George A. Rauscher</strong>, forensic expert with 25+ years experience.
</p>
</div>
</div>
</main>
<footer class="footer">
<div class="footer-content">
<div class="footer-section">
<p class="footer-text">
<a href="https://encryptor.app" target="_blank" style="color: inherit; text-decoration: none;">Powered by encryptor.app</a><br>
Version 2.2.0 - Zero-Knowledge Encryption<br>
<span style="font-size: 0.8em; opacity: 0.7;">Built for freedom. Built for privacy. Built for those who need it most.</span>
</p>
</div>
<div class="footer-section">
<a href="./imprint.php" class="footer-link">Imprint</a>
<span class="footer-separator">|</span>
<a href="./privacy.php" class="footer-link">Privacy</a>
<span class="footer-separator">|</span>
<a href="./LICENSES.md" class="footer-link">Licenses</a>
</div>
</div>
</footer>
<script src="./js/lucide.js?v=2.2.3"></script>
<script src="./js/password-strength.js?v=2.2.3"></script>
<script src="./licenses-modal.js?v=20251129185000"></script>
<script src="./crypto.js?v=2.2.3"></script>
<script>
// Initialize Lucide icons IMMEDIATELY (no DOMContentLoaded)
if (typeof lucide !== 'undefined' && lucide.icons) {
lucide.createIcons({ icons: lucide.icons });
} else {
console.error('Lucide not loaded or icons not available!');
}
// Character counter
const plaintextArea = document.getElementById('plaintext');
const charCount = document.getElementById('charCount');
plaintextArea.addEventListener('input', () => {
charCount.textContent = plaintextArea.value.length;
});
// Password visibility toggle
const passwordInput = document.getElementById('password');
const toggleButton = document.getElementById('togglePassword');
const toggleIcon = document.getElementById('toggleIcon');
toggleButton.addEventListener('click', () => {
const type = passwordInput.type === 'password' ? 'text' : 'password';
passwordInput.type = type;
toggleIcon.setAttribute('data-lucide', type === 'password' ? 'eye' : 'eye-off');
lucide.createIcons({ icons: lucide.icons });
});
// Password strength meter with LIVE TIPS and WOW EFFECT
passwordInput.addEventListener('input', () => {
const password = passwordInput.value;
const analysis = window.PasswordStrength.analyze(password);
window.PasswordStrength.updateMeter(analysis);
});
// Password generator
document.getElementById('generatePassword').addEventListener('click', () => {
const charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]{}|;:,.<>?';
const length = 32; // Quantum-resistant: ~211 bits entropy (~105 bits post-quantum, safe for 50+ years)
let password = '';
const array = new Uint32Array(length);
crypto.getRandomValues(array);
for (let i = 0; i < length; i++) {
password += charset[array[i] % charset.length];
}
passwordInput.value = password;
passwordInput.type = 'text';
toggleIcon.setAttribute('data-lucide', 'eye-off');
lucide.createIcons({ icons: lucide.icons });
// Trigger strength meter manually (more reliable than dispatchEvent)
if (window.PasswordStrength) {
const analysis = window.PasswordStrength.analyze(password);
window.PasswordStrength.updateMeter(analysis);
}
showAlert('Password generated! Make sure to save it somewhere safe.', 'success');
});
// Form submission
document.getElementById('encryptForm').addEventListener('submit', async (e) => {
e.preventDefault();
const plaintext = plaintextArea.value;
const password = passwordInput.value;
if (password.length < 12) {
showAlert('Password must be at least 12 characters long.', 'error');
return;
}
try {
const encryptBtn = document.getElementById('encryptBtn');
encryptBtn.disabled = true;
encryptBtn.innerHTML = '<i data-lucide="loader-2" class="btn-icon" style="animation: spin 1s linear infinite;"></i><span>Encrypting...</span>';
lucide.createIcons({ icons: lucide.icons });
const encrypted = await encryptText(plaintext, password);
document.getElementById('encryptedOutput').textContent = encrypted;
document.getElementById('resultContainer').classList.remove('hidden');
document.getElementById('encryptForm').style.display = 'none';
showAlert('Message encrypted successfully!', 'success');
} catch (error) {
showAlert('Encryption failed: ' + error.message, 'error');
} finally {
const encryptBtn = document.getElementById('encryptBtn');
encryptBtn.disabled = false;
encryptBtn.innerHTML = '<i data-lucide="lock" class="btn-icon"></i><span>Encrypt Message</span>';
lucide.createIcons({ icons: lucide.icons });
}
});
// Copy to clipboard
document.getElementById('copyBtn').addEventListener('click', async () => {
const output = document.getElementById('encryptedOutput').textContent;
try {
await navigator.clipboard.writeText(output);
const copyBtn = document.getElementById('copyBtn');
const originalHTML = copyBtn.innerHTML;
copyBtn.innerHTML = '<i data-lucide="check" class="btn-icon"></i><span>Copied!</span>';
lucide.createIcons({ icons: lucide.icons });
setTimeout(() => {
copyBtn.innerHTML = originalHTML;
lucide.createIcons({ icons: lucide.icons });
}, 2000);
showAlert('Encrypted message copied to clipboard!', 'success');
} catch (error) {
showAlert('Failed to copy: ' + error.message, 'error');
}
});
// Reset form
document.getElementById('resetBtn').addEventListener('click', () => {
document.getElementById('encryptForm').reset();
document.getElementById('encryptForm').style.display = 'block';
document.getElementById('resultContainer').classList.add('hidden');
charCount.textContent = '0';
document.getElementById('strengthFill').style.width = '0%';
document.getElementById('strengthText').textContent = 'None';
passwordInput.type = 'password';
toggleIcon.setAttribute('data-lucide', 'eye');
lucide.createIcons({ icons: lucide.icons });
clearAlerts();
});
function showAlert(message, type) {
const alertContainer = document.getElementById('alertContainer');
const iconName = type === 'success' ? 'check-circle' : type === 'error' ? 'x-circle' : 'alert-triangle';
const alert = document.createElement('div');
alert.className = `alert alert-${type}`;
alert.innerHTML = `
<i data-lucide="${iconName}" class="alert-icon"></i>
<div>${message}</div>
`;
alertContainer.appendChild(alert);
lucide.createIcons({ icons: lucide.icons });
setTimeout(() => {
alert.remove();
}, 5000);
}
function clearAlerts() {
document.getElementById('alertContainer').innerHTML = '';
}
// Keyframe for spinner animation
const style = document.createElement('style');
style.textContent = `
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
`;
document.head.appendChild(style);
</script>
</body>
</html>