-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdecrypt.html
More file actions
415 lines (366 loc) · 21.4 KB
/
decrypt.html
File metadata and controls
415 lines (366 loc) · 21.4 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
<!--
encryptor.app - DECRYPT 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="apple-mobile-web-app-capable" content="yes">
<title>Decrypt Message - AES-256-GCM | encryptor.app</title>
<meta name="description" content="Decrypt AES-256-GCM encrypted messages. Client-side only. Zero-knowledge. Your data never touches our servers. Free forever.">
<meta name="keywords" content="decrypt text, AES-256, text decryption, decrypt message, decrypt online, client-side decryption">
<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">
</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">Encrypt Text</a>
<a href="./decrypt.html" class="nav-link active">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>Decrypt Message</h1>
<p>Your text will be decrypted in your browser. It never touches our servers.</p>
</div>
<div id="alertContainer"></div>
<form id="decryptForm">
<div class="form-group">
<label for="ciphertext" class="form-label">
<i data-lucide="file-lock" style="width: 16px; height: 16px; display: inline-block; vertical-align: middle;"></i>
Encrypted Message
</label>
<textarea
id="ciphertext"
class="form-textarea"
placeholder="Paste the encrypted message here..."
rows="8"
required
></textarea>
</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="Enter the password used to encrypt"
required
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>
<div class="form-actions">
<button type="submit" class="btn btn-primary" id="decryptBtn">
<i data-lucide="unlock" class="btn-icon"></i>
<span>Decrypt 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>
Decrypted Message
</label>
<div class="result-output" id="decryptedOutput"></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>Decrypt Another</span>
</button>
</div>
</div>
<div class="alert alert-warning" style="margin-top: var(--spacing-lg);">
<i data-lucide="shield-alert" class="alert-icon"></i>
<div>
<strong>Security Notice:</strong> Make sure to delete the decrypted message
after reading if you no longer need it. Secure communication requires secure cleanup.
</div>
</div>
</div>
</div>
<!-- HOW DECRYPTION 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="unlock" style="width: 28px; height: 28px; display: inline-block; vertical-align: middle; margin-right: 0.5rem;"></i>
How Text Decryption Works
</h2>
<p style="color: var(--slate-300); line-height: 1.7; margin-bottom: 1.5rem; font-size: 1rem;">
Decryption mirrors the encryption process in reverse. Your encrypted text stays in your browser's memory and never
touches our servers. Here's what happens when you click "Decrypt 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">Parse Encrypted Data</h3>
<p class="step-text">
Your encrypted text is Base64-decoded into binary data. The browser extracts the salt (16 bytes),
IV (12 bytes), ciphertext, and authentication tag from the encrypted package.
</p>
</div>
</div>
<div class="step-container">
<div class="step-number">2</div>
<div class="step-content">
<h3 class="step-title">Derive Decryption Key</h3>
<p class="step-text">
Using the extracted salt and your password, the browser runs PBKDF2-SHA-256 with 100,000 iterations
to derive the same 256-bit key that was used for encryption. Wrong password = wrong key = decryption fails.
</p>
</div>
</div>
<div class="step-container">
<div class="step-number">3</div>
<div class="step-content">
<h3 class="step-title">Verify and Decrypt</h3>
<p class="step-text">
AES-256-GCM verifies the authentication tag before decryption. If the ciphertext was tampered with
or the password is wrong, the authentication check fails and decryption stops immediately. No partial decryption.
</p>
</div>
</div>
<div class="step-container">
<div class="step-number">4</div>
<div class="step-content">
<h3 class="step-title">Display Original Message</h3>
<p class="step-text">
If authentication passes, the ciphertext is decrypted and your original plaintext message is displayed.
Identical to what was encrypted. If anything fails, you see "Wrong password or corrupted data" - by design.
</p>
</div>
</div>
</div>
<div style="margin-top: 2rem; display: grid; gap: 1rem;">
<div class="warning-box error">
<p>
<strong class="warning-label error">Wrong Password:</strong> If you enter the wrong password, decryption will fail
immediately. There is no password recovery. No hints. No backdoors. Write it down securely or use a password manager.
</p>
</div>
<div class="warning-box warning">
<p>
<strong class="warning-label warning">Tamper Detection:</strong> If anyone modified the encrypted text
(even one character), the GCM authentication tag will fail and decryption stops. You get the original message or nothing.
</p>
</div>
<div class="warning-box info">
<p>
<strong class="warning-label info">Zero-Knowledge Architecture:</strong> Your encrypted text never leaves your browser.
We don't see your ciphertext, your password, or your decrypted message. The server only delivers static files.
</p>
</div>
</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>
Why This Is Secure
</h2>
<p style="color: var(--slate-300); line-height: 1.7; margin-bottom: 1.5rem; font-size: 1rem;">
<strong style="color: var(--slate-200);">Zero-Knowledge means exactly that:</strong>
</p>
<ul style="color: var(--slate-400); line-height: 1.8; margin-bottom: 1.5rem; margin-left: 1.5rem;">
<li>We don't see your encrypted text (never uploaded)</li>
<li>We don't see your password (entered in your browser only)</li>
<li>We don't see your decrypted message (displayed in your browser)</li>
<li>We don't log when you decrypt (no analytics, no tracking)</li>
<li>We can't decrypt your message even if we wanted to (we never receive it)</li>
</ul>
<p style="color: var(--slate-300); line-height: 1.7; font-size: 1rem;">
This isn't a privacy promise. <strong style="color: var(--slate-200);">It's a technical reality.</strong>
The architecture makes it impossible for us to access your messages. Client-side encryption isn't just more private -
it's the only way to guarantee privacy.
</p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--slate-700);">
<div>
<div style="color: var(--slate-500); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem;">Decryption 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;">Authenticated decryption</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;">Same 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;">Tampering Detection</div>
<div style="color: var(--slate-200); font-weight: 600;">GCM Auth Tags</div>
<div style="color: var(--slate-400); font-size: 0.875rem;">Automatic verification</div>
</div>
<div>
<div style="color: var(--slate-500); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem;">Processing Location</div>
<div style="color: var(--slate-200); font-weight: 600;">Your Browser</div>
<div style="color: var(--slate-400); font-size: 0.875rem;">Never server-side</div>
</div>
</div>
</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="./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!');
}
// 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 });
});
// Form submission
document.getElementById('decryptForm').addEventListener('submit', async (e) => {
e.preventDefault();
const ciphertext = document.getElementById('ciphertext').value;
const password = passwordInput.value;
try {
const decryptBtn = document.getElementById('decryptBtn');
decryptBtn.disabled = true;
decryptBtn.innerHTML = '<i data-lucide="loader-2" class="btn-icon" style="animation: spin 1s linear infinite;"></i><span>Decrypting...</span>';
lucide.createIcons({ icons: lucide.icons });
const decrypted = await decryptText(ciphertext, password);
document.getElementById('decryptedOutput').textContent = decrypted;
document.getElementById('resultContainer').classList.remove('hidden');
document.getElementById('decryptForm').style.display = 'none';
showAlert('Message decrypted successfully!', 'success');
} catch (error) {
let errorMessage = 'Decryption failed. ';
if (error.message.includes('Invalid') || error.message.includes('format')) {
errorMessage += 'The encrypted message appears to be corrupted or invalid.';
} else if (error.message.includes('password')) {
errorMessage += 'Wrong password or corrupted data.';
} else {
errorMessage += error.message;
}
showAlert(errorMessage, 'error');
const decryptBtn = document.getElementById('decryptBtn');
decryptBtn.disabled = false;
decryptBtn.innerHTML = '<i data-lucide="unlock" class="btn-icon"></i><span>Decrypt Message</span>';
lucide.createIcons({ icons: lucide.icons });
}
});
// Copy to clipboard
document.getElementById('copyBtn').addEventListener('click', async () => {
const output = document.getElementById('decryptedOutput').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('Decrypted message copied to clipboard!', 'success');
} catch (error) {
showAlert('Failed to copy: ' + error.message, 'error');
}
});
// Reset form
document.getElementById('resetBtn').addEventListener('click', () => {
document.getElementById('decryptForm').reset();
document.getElementById('decryptForm').style.display = 'block';
document.getElementById('resultContainer').classList.add('hidden');
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>