-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
209 lines (206 loc) · 6.62 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<title>PBKDF2 + AES256-GCM Stores</title>
</head>
<body class="mx-auto min-h-[100dvh] w-full max-w-7xl px-2 py-4">
<div id="app" class="px-3.5 pb-2 sm:px-1"></div>
<main
class="grid grid-cols-1 gap-4 divide-y sm:grid-cols-2 sm:divide-x sm:divide-y-0"
>
<section class="px-3.5 py-3.5 sm:px-1">
<h2 class="pb-2 text-xl">Maker</h2>
<form id="maker-form" class="flex flex-col gap-2">
<div class="grid grid-cols-2 gap-2">
<div class="flex flex-col">
<div class="flex gap-2">
<label for="maker-password">Password</label>
<button
id="maker-password-copy"
type="button"
class="text-xs text-red-500"
>
Copy
</button>
</div>
<input
type="text"
id="maker-password"
name="password"
value="@Password1"
placeholder="eg: any password"
class="flex-1 text-sm disabled:cursor-not-allowed disabled:bg-slate-200"
required
/>
</div>
<div class="flex flex-col">
<label for="maker-iterations">PBKDF2 Iterations</label>
<input
type="number"
id="maker-iterations"
min="100000"
name="iterations"
value="600000"
step="100000"
placeholder="eg: 600,000"
class="text-sm disabled:cursor-not-allowed disabled:bg-slate-200"
required
/>
</div>
</div>
<div>
<label for="maker-plaintext">Input</label>
<textarea
id="maker-plaintext"
class="h-16 w-full text-sm"
name="plaintext"
required
>
Hello world</textarea
>
</div>
<div class="flex flex-wrap gap-1">
<button
type="submit"
class="rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300"
id="maker-submit"
>
Encrypt plaintext input
</button>
<button
type="reset"
class="rounded bg-slate-500 px-4 py-2 font-bold text-white hover:bg-slate-700"
>
Reset
</button>
</div>
<div
class="break-before-all border p-1 text-xs"
id="maker-output-parent"
style="display: none"
>
<div class="flex justify-between pb-2">
<span>Output</span>
<button type="button" id="maker-output-copy" class="text-red-500">
Copy
</button>
</div>
<code>
<pre id="maker-output" class="min-h-[50px] overflow-x-auto">
{}</pre
>
</code>
</div>
<div
class="break-all border p-1 text-xs"
id="maker-raw-store-parent"
style="display: none"
>
<div class="pb-2">
<span>Raw Store</span>
</div>
<code>
<pre
id="maker-raw-store"
class="max-h-32 overflow-y-auto overflow-x-scroll"
>
{}</pre
>
</code>
</div>
<div
class="break-all border p-1 text-xs"
id="maker-store-parent"
style="display: none"
>
<div class="pb-2">
<span>Store Encrypted</span>
</div>
<code>
<pre
id="maker-store"
class="max-h-32 overflow-y-auto overflow-x-scroll"
>
[]</pre
>
</code>
</div>
</form>
</section>
<section class="px-3.5 py-3.5">
<h2 class="pb-2 text-xl">Importer</h2>
<form id="import-form" class="flex flex-col gap-2">
<div>
<label for="import-blob">Blob</label>
<textarea
id="import-blob"
class="h-36 w-full text-sm"
name="blob"
required
placeholder="paste the blob here"
></textarea>
</div>
<div class="flex flex-col">
<label for="import-password">Password</label>
<input
type="text"
id="import-password"
name="password"
value=""
placeholder="password used on the blob"
class="text-sm disabled:cursor-not-allowed disabled:bg-slate-200"
required
/>
</div>
<div class="flex gap-1">
<button
id="import-submit"
type="submit"
class="rounded bg-orange-500 px-4 py-2 font-bold text-white hover:bg-orange-700 disabled:cursor-not-allowed disabled:bg-orange-300"
>
Decrypt blob
</button>
<button
type="reset"
class="rounded bg-slate-500 px-4 py-2 font-bold text-white hover:bg-slate-700"
>
Clear
</button>
</div>
<div
id="import-result-parent"
class="break-all border p-1 text-xs"
style="display: none"
>
<div class="flex justify-between pb-2">
<div>
<span>Decrypted result - </span>
<span id="import-result-time">0s</span>
</div>
<button
type="button"
id="import-result-copy"
class="text-red-500"
>
Copy
</button>
</div>
<code>
<pre
id="import-result"
class="max-h-32 overflow-y-auto overflow-x-scroll"
></pre>
</code>
</div>
</form>
</section>
</main>
<script type="module" src="/src/main.ts"></script>
</body>
</html>