-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
433 lines (408 loc) · 16.1 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steganography Tool - CheckmateBegins</title>
<meta name="description" content="A powerful steganography tool for hiding and extracting secret messages in images.">
<meta name="keywords" content="steganography, image encryption, secret messages, data hiding">
<meta name="author" content="CheckmateBegins">
<meta property="og:title" content="Steganography Tool - CheckmateBegins">
<meta property="og:description" content="Hide and extract secret messages in images with our advanced steganography tool.">
<meta property="og:image" content="https://begins.site/og-image.jpg">
<meta property="og:url" content="https://begins.site/steganography-tool">
<meta name="twitter:card" content="summary_large_image">
<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=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--primary: #bb86fc;
--primary-variant: #3700b3;
--secondary: #03dac6;
--background: #121212;
--surface: #1e1e1e;
--error: #cf6679;
--on-primary: #000000;
--on-background: #ffffff;
--on-surface: #ffffff;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', sans-serif;
background-color: var(--background);
color: var(--on-background);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.nav {
width: 100%;
background-color: rgba(0, 0, 0, 0.5);
padding: 1rem;
position: fixed;
top: 0;
z-index: 1000;
backdrop-filter: blur(10px);
}
.nav-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.nav-logo {
color: var(--on-background);
text-decoration: none;
font-weight: 700;
font-size: 1.2rem;
}
.nav-back {
color: var(--secondary);
text-decoration: none;
padding: 0.5rem 1rem;
border-radius: 4px;
transition: all 0.3s ease;
}
.nav-back:hover {
background-color: rgba(3, 218, 198, 0.1);
}
.container {
width: 100%;
max-width: 800px;
padding: 20px;
margin-top: 80px;
text-align: center;
}
h1, h2 {
color: var(--on-background);
font-weight: 700;
letter-spacing: -0.025em;
}
h1 {
font-size: 2.5rem;
margin-bottom: 1.5rem;
}
h2 {
font-size: 1.8rem;
margin-bottom: 1rem;
}
.section {
background-color: var(--surface);
border-radius: 12px;
padding: 2rem;
margin-bottom: 2rem;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}
.section p {
margin-bottom: 1rem;
line-height: 1.6;
text-align: left;
}
.file-input-wrapper {
margin: 1rem 0;
}
.file-input-button {
background-color: var(--surface);
color: var(--on-background);
padding: 0.75rem 1.5rem;
border-radius: 6px;
border: 2px solid var(--primary);
cursor: pointer;
font-weight: 500;
transition: all 0.3s ease;
display: inline-block;
}
.file-input-button:hover {
background-color: var(--primary);
color: var(--on-primary);
}
.file-input-wrapper input[type=file] {
display: none;
}
.file-name {
margin-top: 0.5rem;
font-size: 0.9rem;
color: var(--secondary);
}
textarea {
width: 100%;
padding: 1rem;
margin: 1rem 0;
background-color: rgba(255, 255, 255, 0.05);
color: var(--on-background);
border: 2px solid var(--surface);
border-radius: 6px;
font-family: 'Inter', sans-serif;
font-size: 1rem;
transition: all 0.3s ease;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
textarea:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 2px rgba(187,134,252,0.2);
}
button {
background-color: var(--primary);
color: var(--on-primary);
border: none;
padding: 0.75rem 1.5rem;
border-radius: 6px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
font-size: 1rem;
font-family: 'Inter', sans-serif;
}
button:hover {
background-color: var(--primary-variant);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(187,134,252,0.2);
}
img {
max-width: 100%;
border-radius: 8px;
margin: 1.5rem auto;
display: block;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
transition: transform 0.3s ease;
}
#downloadLink {
display: inline-block;
margin-top: 1.5rem;
color: var(--secondary);
text-decoration: none;
padding: 0.75rem 1.5rem;
border-radius: 6px;
font-weight: 500;
transition: all 0.3s ease;
}
#downloadLink:hover {
background-color: rgba(3, 218, 198, 0.1);
}
.loading {
display: none;
margin: 1.5rem 0;
}
.loading::after {
content: '';
display: inline-block;
width: 24px;
height: 24px;
border: 3px solid var(--primary);
border-radius: 50%;
border-top-color: transparent;
animation: spin 1s linear infinite;
}
.copyright {
margin-top: auto;
padding: 2rem;
text-align: center;
font-size: 0.9rem;
color: var(--on-background);
opacity: 0.7;
}
.copyright a {
color: var(--secondary);
text-decoration: none;
transition: all 0.3s ease;
}
.copyright a:hover {
color: var(--primary);
text-decoration: underline;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.fade-in {
animation: fadeIn 0.5s ease-out;
}
</style>
</head>
<body>
<nav class="nav">
<div class="nav-content">
<a href="https://Begins.site" class="nav-logo">CheckmateBegins</a>
<a href="https://Begins.site" class="nav-back">Back to Homepage</a>
</div>
</nav>
<div class="container">
<h1 class="fade-in">Steganography Tool</h1>
<div class="section fade-in">
<h2>Hide Message</h2>
<div class="file-input-wrapper">
<label class="file-input-button">
Choose Image
<input type="file" id="imageInput" accept="image/*">
</label>
<div id="imageFileName" class="file-name"></div>
</div>
<textarea id="secretMessage" rows="4" placeholder="Enter your secret message here"></textarea>
<button onclick="hideMessage()">Hide Message</button>
<div class="loading" id="hideLoading"></div>
<img id="imagePreview" alt="Image Preview" style="display: none;">
<a id="downloadLink" style="display: none;">Download Steganographic Image</a>
</div>
<div class="section fade-in">
<h2>Extract Message</h2>
<div class="file-input-wrapper">
<label class="file-input-button">
Choose Image
<input type="file" id="extractImageInput" accept="image/*">
</label>
<div id="extractImageFileName" class="file-name"></div>
</div>
<button onclick="extractMessage()">Extract Message</button>
<div class="loading" id="extractLoading"></div>
<textarea id="extractedMessage" rows="4" readonly placeholder="Extracted message will appear here"></textarea>
<img id="extractedImagePreview" alt="Extracted Image Preview" style="display: none;">
</div>
<div class="section fade-in">
<h2>About Steganography</h2>
<p>Steganography is the art and science of hiding information within other seemingly innocent files or messages. This ancient practice has evolved into a sophisticated digital technique, crucial in the realms of cybersecurity and data privacy.</p>
<h3>How Our Tool Works</h3>
<p>This steganography tool employs the Least Significant Bit (LSB) technique to embed secret messages within image files:</p>
<ul>
<li><strong>Encoding:</strong> The tool converts your message into binary and subtly alters the least significant bits of the image's pixel data to store this information.</li>
<li><strong>Decoding:</strong> To extract the hidden message, the tool reads these least significant bits, reconstructing the original message.</li>
</ul>
<h3>Applications of Steganography</h3>
<p>Steganography finds legitimate use in various fields:</p>
<ul>
<li>Digital Watermarking for copyright protection</li>
<li>Secure Communication in sensitive environments</li>
<li>Enhancing data privacy in storage and transmission</li>
</ul>
<p><strong>Note:</strong> While steganography can be a powerful tool for privacy, it's crucial to use such technologies responsibly and in compliance with applicable laws and regulations.</p>
</div>
<div class="copyright fade-in">
© 2023 <a href="https://Begins.site" target="_blank">CheckmateBegins</a>. All rights reserved.
</div>
</div>
<script>
let originalImage;
let extractImage;
document.getElementById('imageInput').addEventListener('change', function(e) {
handleImageInput(e, 'imagePreview', 'imageFileName');
originalImage = document.getElementById('imagePreview');
});
document.getElementById('extractImageInput').addEventListener('change', function(e) {
handleImageInput(e, 'extractedImagePreview', 'extractImageFileName');
extractImage = document.getElementById('extractedImagePreview');
});
function handleImageInput(e, previewId, fileNameId) {
const file = e.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(event) {
const img = new Image();
img.onload = function() {
const preview = document.getElementById(previewId);
preview.src = img.src;
preview.style.display = 'block';
preview.classList.add('fade-in');
}
img.src = event.target.result;
}
reader.readAsDataURL(file);
document.getElementById(fileNameId).textContent = file.name;
}
}
function hideMessage() {
const message = document.getElementById('secretMessage').value;
if (!originalImage || !message) {
alert('Please select an image and enter a message.');
return;
}
document.getElementById('hideLoading').style.display = 'block';
setTimeout(() => {
const canvas = document.createElement('canvas');
canvas.width = originalImage.width;
canvas.height = originalImage.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(originalImage, 0, 0);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const data = imageData.data;
const binaryMessage = message.split('').map(char =>
char.charCodeAt(0).toString(2).padStart(8, '0')
).join('') + '00000000';
let messageIndex = 0;
for (let i = 0; i < data.length; i += 4) {
if (messageIndex < binaryMessage.length) {
data[i] = (data[i] & 254) | parseInt(binaryMessage[messageIndex]);
messageIndex++;
} else {
break;
}
}
ctx.putImageData(imageData, 0, 0);
const downloadLink = document.getElementById('downloadLink');
downloadLink.href = canvas.toDataURL('image/png');
downloadLink.download = 'steganographic_image.png';
downloadLink.style.display = 'inline-block';
downloadLink.textContent = 'Download Steganographic Image';
downloadLink.classList.add('fade-in');
document.getElementById('hideLoading').style.display = 'none';
}, 100);
}
function extractMessage() {
if (!extractImage) {
alert('Please select an image to extract the message from.');
return;
}
document.getElementById('extractLoading').style.display = 'block';
setTimeout(() => {
const canvas = document.createElement('canvas');
canvas.width = extractImage.width;
canvas.height = extractImage.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(extractImage, 0, 0);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const data = imageData.data;
let binaryMessage = '';
for (let i = 0; i < data.length; i += 4) {
binaryMessage += data[i] & 1;
if (binaryMessage.length % 8 === 0 && binaryMessage.slice(-8) === '00000000') {
break;
}
}
const message = binaryMessage.match(/.{8}/g).slice(0, -1).map(byte =>
String.fromCharCode(parseInt(byte, 2))
).join('');
const extractedMessageElement = document.getElementById('extractedMessage');
extractedMessageElement.value = message;
extractedMessageElement.classList.add('fade-in');
document.getElementById('extractLoading').style.display = 'none';
}, 100);
}
</script>
<script>
document.addEventListener('contextmenu', event => event.preventDefault());
document.addEventListener('keydown', event => {
if (event.ctrlKey && (event.key === 'c' || event.key === 'u' || event.key === 's')) {
event.preventDefault();
}
});
</script>
</body>
</html>