-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
109 lines (95 loc) · 5.42 KB
/
index.html
File metadata and controls
109 lines (95 loc) · 5.42 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content='width=device-width, initial-scale=1' name='viewport'/>
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; manifest-src 'self'">
<title>Text Encrypt</title>
<link rel="stylesheet" href="assets/styles.css">
<!-- favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon_io/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon_io/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon_io/favicon-16x16.png">
<link rel="manifest" href="assets/favicon_io/site.webmanifest">
</head>
<body>
<div class="bg-grid"></div>
<div class="bg-noise"></div>
<main class="container">
<div class="card">
<!-- autocomplete=off on form + no new-password on input avoids Chrome “strong password” / save prompts -->
<form class="card-form" autocomplete="off" onsubmit="return false;">
<header class="card-header">
<div class="lock-icon">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="11" width="18" height="11" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M7 11V7a5 5 0 0 1 10 0v4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<circle cx="12" cy="16" r="1.5" fill="currentColor"/>
</svg>
</div>
<h1>Encrypt <span class="accent">/</span> Decrypt</h1>
<p class="tagline">AES-256 · CBC · PBKDF2</p>
</header>
<div class="field-group">
<label for="Text">Plaintext</label>
<textarea id="Text" name="Text" placeholder="Enter text to encrypt, or paste ciphertext to decrypt…" spellcheck="false" autocomplete="off"></textarea>
</div>
<div class="field-group">
<label for="Password">Passphrase</label>
<div class="input-wrapper">
<input id="Password" type="password" name="passphrase" placeholder="Enter secret passphrase" autocomplete="off" autocapitalize="off" spellcheck="false" data-lpignore="true" data-1p-ignore="true" data-bwignore data-form-type="other">
<button class="toggle-pw" id="togglePw" aria-label="Toggle passphrase visibility" type="button">
<svg class="eye-icon eye-open" viewBox="0 0 24 24" fill="none" style="display:none">
<path d="M1 12C1 12 5 4 12 4s11 8 11 8-4 8-11 8S1 12 1 12z" stroke="currentColor" stroke-width="1.5"/>
<circle cx="12" cy="12" r="3" stroke="currentColor" stroke-width="1.5"/>
</svg>
<svg class="eye-icon eye-closed" viewBox="0 0 24 24" fill="none">
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<line x1="1" y1="1" x2="23" y2="23" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
</button>
</div>
</div>
<div class="actions">
<button type="button" id="Encrypt" class="btn btn-encrypt">
<svg class="btn-icon" viewBox="0 0 24 24" fill="none">
<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
</svg>
<span class="btn-text">Encrypt</span>
</button>
<button type="button" id="Decrypt" class="btn btn-decrypt">
<svg class="btn-icon" viewBox="0 0 24 24" fill="none">
<rect x="3" y="11" width="18" height="11" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M7 11V7a5 5 0 0 1 9.9-1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
<span class="btn-text">Decrypt</span>
</button>
</div>
<div class="field-group">
<label for="Ciphertext">Ciphertext</label>
<div class="textarea-wrapper">
<textarea id="Ciphertext" name="result" placeholder="Encrypted output appears here…" spellcheck="false"></textarea>
<button class="copy-btn" id="copyBtn" aria-label="Copy ciphertext" title="Copy to clipboard" type="button">
<svg class="copy-icon" viewBox="0 0 24 24" fill="none">
<rect x="9" y="9" width="13" height="13" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" stroke="currentColor" stroke-width="1.5"/>
</svg>
<svg class="check-icon" viewBox="0 0 24 24" fill="none" style="display:none">
<polyline points="20 6 9 17 4 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
</div>
<footer class="card-footer">
<div class="footer-bottom">
<a href="https://github.com/bsgrigorov/text-encrypt" class="gh-link">bsgrigorov/text-encrypt</a>
</div>
</footer>
</form>
</div>
</main>
<div id="toastContainer" class="toast-container" aria-live="polite" aria-atomic="true"></div>
<script src="encryption.js"></script>
</body>
</html>