Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
255 lines (247 loc) · 8.92 KB
/
Copy pathindex.html
File metadata and controls
255 lines (247 loc) · 8.92 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PGP Lite - Client-side Encryptor</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<main class="app">
<header class="app__header">
<h1>PGP Lite</h1>
<p class="app__subtitle">
Client-side PGP encryption and decryption using your PGP keys.
</p>
</header>
<section class="card card--tight-top">
<details class="details">
<summary>Generate a new keypair (optional)</summary>
<div class="field-group">
<label class="field-label name-label" for="keyGenName">
Name
</label>
<input
id="keyGenName"
type="text"
class="field-input"
placeholder="Example: Jane Doe"
/>
</div>
<div class="field-group">
<label class="field-label" for="keyGenEmail"> Email </label>
<input
id="keyGenEmail"
type="email"
class="field-input"
placeholder="Example: jane@example.com"
/>
</div>
<div class="field-group">
<label class="field-label" for="keyGenPassphrase">
Passphrase for new private key (optional)
</label>
<input
id="keyGenPassphrase"
type="password"
class="field-input"
placeholder="Leave blank to create an unencrypted private key"
autocomplete="new-password"
/>
</div>
<div class="field-group field-group--actions">
<button id="generateKeypairButton" class="button button--ghost">
Generate & download keypair
</button>
</div>
<p id="keyGenStatus" class="status"></p>
</details>
</section>
<div class="app__keys-row">
<section class="card">
<h2 class="card__title">1. Choose public key</h2>
<div class="field-group">
<label class="field-label" for="keyModeSelect">Key source</label>
<select id="keyModeSelect" class="field-input">
<option value="default">Use default public key</option>
<option value="uploaded">Use your own public key</option>
</select>
</div>
<div class="field-group">
<div class="field-head">
<span class="field-label">Your public key (.asc)</span>
<div class="input-toggle" role="tablist" aria-label="Public key input method">
<button
type="button"
class="input-toggle__option is-active"
data-pane="publicKeyFilePane"
role="tab"
aria-selected="true"
>
Upload file
</button>
<button
type="button"
class="input-toggle__option"
data-pane="publicKeyPastePane"
role="tab"
aria-selected="false"
>
Paste key
</button>
</div>
</div>
<div id="publicKeyFilePane" class="input-pane">
<input
id="publicKeyFile"
type="file"
accept=".asc,.pgp,.gpg,.txt"
class="field-input"
aria-label="Select public key file"
/>
</div>
<div id="publicKeyPastePane" class="input-pane" hidden>
<textarea
id="publicKeyText"
class="field-input field-input--key"
spellcheck="false"
aria-label="Paste public key"
placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----"
></textarea>
</div>
<p id="uploadedKeyInfo" class="field-help">
No public key provided yet. Keys are read only in your browser and
never uploaded to a server.
</p>
</div>
<details class="details">
<summary>Show default public key (for reference)</summary>
<pre id="defaultKeyPreview" class="key-preview"></pre>
</details>
</section>
<section class="card">
<h2 class="card__title">2. Private key (Optional, for decryption)</h2>
<div class="field-group">
<div class="field-head">
<span class="field-label">Private key (.asc)</span>
<div class="input-toggle" role="tablist" aria-label="Private key input method">
<button
type="button"
class="input-toggle__option is-active"
data-pane="privateKeyFilePane"
role="tab"
aria-selected="true"
>
Upload file
</button>
<button
type="button"
class="input-toggle__option"
data-pane="privateKeyPastePane"
role="tab"
aria-selected="false"
>
Paste key
</button>
</div>
</div>
<div id="privateKeyFilePane" class="input-pane">
<input
id="privateKeyFile"
type="file"
accept=".asc,.pgp,.gpg,.txt"
class="field-input"
aria-label="Select private key file"
/>
</div>
<div id="privateKeyPastePane" class="input-pane" hidden>
<textarea
id="privateKeyText"
class="field-input field-input--key"
spellcheck="false"
aria-label="Paste private key"
placeholder="-----BEGIN PGP PRIVATE KEY BLOCK-----"
></textarea>
</div>
<p id="uploadedPrivateKeyInfo" class="field-help">
No private key provided yet. Keys are read only in your browser and
never uploaded to a server.
</p>
</div>
<div class="field-group">
<label class="field-label" for="privateKeyPassphrase">
Private key passphrase (if any)
</label>
<input
id="privateKeyPassphrase"
type="password"
class="field-input"
placeholder="Leave blank if your private key is not encrypted"
autocomplete="current-password"
/>
</div>
<div class="field-group field-group--compact-bottom">
<label class="field-label field-label--inline">
<input id="rememberPassphraseCheckbox" type="checkbox" />
Save passphrase to this device (local storage)
</label>
<p class="field-help">
The passphrase is stored only in your browser's local storage and
never sent to any server.
</p>
</div>
</section>
</div>
<section class="card card--tight-footer">
<h2 class="card__title">3. Encrypt or decrypt text</h2>
<div class="field-group">
<label class="field-label" id="outputTitle" for="plaintextInput">
Text to encrypt / decrypted output
</label>
<textarea
id="plaintextInput"
class="field-input field-input--textarea"
placeholder="Type or paste text to encrypt, or paste an encrypted PGP message to decrypt..."
></textarea>
</div>
<div class="field-group field-group--actions">
<button id="actionButton" class="button button--primary">
Encrypt
</button>
<button id="copyButton" class="button button--ghost">
Copy text
</button>
</div>
<p id="statusMessage" class="status"></p>
</section>
<footer class="app__footer">
<div class="app__footer-inner">
<p>
All encryption happens locally in your browser. No data is sent to
any server.
<br />
<a
class="app__footer-link"
href="https://github.com/JackMBurch/inline-pgp"
target="_blank"
rel="noreferrer"
>
Browser Auto Decrypt
</a>
•
<a
class="app__footer-link"
href="https://github.com/JackMBurch/pgp-lite"
target="_blank"
rel="noreferrer"
>
Source Code
</a>
</p>
</div>
</footer>
</main>
<script src="https://unpkg.com/openpgp@5/dist/openpgp.min.js"></script>
<script src="main.js"></script>
</body>
</html>