-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·399 lines (361 loc) · 22 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
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<style type="text/css" media="print,screen">
* {
color: #000000;
background-color: #FFFFFF;
}
body {
font-size: 11pt;
}
.output {
width:100%;
}
#footer {
font-size: x-small;
text-align: center;
}
#date {
text-align: center;
font-size: x-small;
}
#key {
padding: 9pt;
text-align: left; /* just to get rid of exotic default configurations with 'justified' or so */
border: solid black 3px;
}
/* this class attempts to make characters readable by OCR software */
.data {
color: black;
letter-spacing: 0.1em; /* characters need to be well separated to have a chance to be recognized by OCR */
font-family: Consolas, Inconsolata, Courier new, monospace; /* fonts must allow to distinguish all cases, letters and numbers (e.g. i-I-l-1, o-O-0) */
font-size: 10pt; /* use +/- buttons in the page to change it */
}
table#keyframe {
width:100%;
text-align: center;
border-collapse: collapse;
border: none;
}
#keyframe td {
}
#keyframe {
margin-top: 5pt;
}
#datatitle {
text-align: center;
}
#datatitle h1 {
padding:0;
margin:0;
}
#characterset .title {
font-style: italic;
}
code, pre.code {
display: block;
white-space: pre-wrap;
background-color: #DDDDDD !important;
}
</style>
<style type="text/css" media="print">
#input {
display:none; /* hides input data that must not be printed */
}
#page1 {
page-break-after: always;
}
a, a:visited {
text-decoration: none;
}
.hideme {
display: none;
}
</style>
<style type="text/css" media="screen">
#showhidelink {
font-size: xx-small;
float:right;
}
#input {
display:visible;
}
.biginfo, #form label {
color: #0099FF;
font-weight: bold;
}
.smallinfo {
display: block;
color: #0099FF;
font-weight: normal;
font-style: italic;
}
#form label .hint {
font-weight: normal;
font-size: smaller;
}
#intro {
color: #444444;
text-align: justify;
}
.output {
border: solid 2px #DDDDDD;
}
.output, .output * {
background-color: #EEEEEE;
}
#inkey {
font-family: Courier, Sans;
font-size: xx-small;
}
#notice {
font-weight: bold;
color: #669933;
}
#fontsize {
text-align: center;
}
.fontbutton {
background-color: white;
padding-left: .5em;
padding-right: .5em;
text-decoration: none;
}
</style>
<script type="text/javascript">
/** Code from http://www.white-hat-web-design.co.uk/blog/controlling-font-size-with-javascript */
var min=6;
var max=40;
var def=10; // default size in 'pt' ; must be equals to .data{font-size}
function increaseFontSize() {
var key = document.getElementById("key");
if( key.style.fontSize ) {
var s = parseInt( key.style.fontSize.replace("pt","") );
} else {
var s = def;
}
if( s != max ) {
s += 1;
}
key.style.fontSize = s+"pt";
}
function decreaseFontSize() {
var key = document.getElementById("key");
if( key.style.fontSize ) {
var s = parseInt( key.style.fontSize.replace("pt","") );
} else {
var s = def;
}
if( s != min ) {
s -= 1;
}
key.style.fontSize = s+"pt";
}
</script>
<script type="text/javascript">
/** Updates the printable part with form data */
function update() {
document.getElementById("timestamp").innerHTML = new Date();
document.getElementById("key").innerHTML = document.getElementById("inkey").value;
document.getElementById("datacomment").innerHTML = document.getElementById("incomment").value;
var keyAlias = document.getElementById("inkeyalias").value;
if ( keyAlias != null && keyAlias.length > 0 ) {
document.getElementById("keyalias_def").style.display = "none";
document.getElementById("keyalias").innerHTML = keyAlias;
} else {
document.getElementById("keyalias_def").style.display = "";
document.getElementById("keyalias").innerHTML = "";
}
}
/** fills the form with demo data */
function demo() {
var sampleKey_RSAPEM = "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAXbjIm8OXPTuZ\nP2Eou+Fr9FI5aj5knw4gM3QC3e2RRqLIqZeSOmChAs4i6NDeoqSk6ofdZMUiOGA7\nmOelle6IjvAGd3G6MoxaYjUfKN2lEfZ1nAM+jQszDD8Ix2hKkzBlG0O8ZUe8+FVI\nj8z0gccSKQJvlV+RX7Zexo43oxt7552fy8jE0zBWGrcj/KblyfvO97tXaaOYJ9kk\n5QfVN7ZandOmYS8Jab0k53oZ+MGC35h+a4XEaTSwYheaDtkxDv9GYqaDAJfrwDbt\nMSc/vIVoeggIh4HnkXVFJiC9mk3ljzB9WyKHcsaeItPMemci2vjIvFnvIB/Skzsq\nE2ce7XW1AgMBAAECggEAS230oSUC4vDtx7+kd3aEg/I/s6fHY2lC/rluShl/qDGM\nbyag+oPNlBUng2TLUiFwcgJM2DFFY4+7nGLuom1SJVX3JHH9tEdR5bcQoXFCyBFt\nFNziIMrpk1C//s9CQ8vHdD3mp58HLEAsINHSSiYBS0utWte1q6leN3egGIzqoACa\nMwd1A0Il/Kk4e0iLKawR6IdYfZLkRHK0x3osjQVK06jvhQyiz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EQbtvBSjth3eBEcCUGYsb1GVH6HVt1UKYwd0oeDygxIwS8awLGKJr\nynjxpg06Z/JzF9dz8aocPwOWLelXhoUuQpzg1hxzXyII6GcmkyV9jox64Cuyz0oZ\nqEsMlDicsPdMaJs4Y5/yI1ZzTJMOD+g=\n-----END CERTIFICATE-----";
document.getElementById("inkey").value = sampleKey_RSAPEM;
document.getElementById("inkeyalias").value = "foo@android";
document.getElementById("incomment").value = "Password : foobar<br>Enjoy !";
update();
}
</script>
<title>Paper backup for cryptographic keys</title>
</head>
<body onload="javascript:demo();">
<!-- FORM PRESENTATION AND INPUT DATA -->
<div id="input">
<h1>Paper backup for cryptographic key</h1>
<!-- INPUT DATA -->
<p id="intro">Use this page to pretty-print your cryptographic key to paper as a 'disconnected' backup.<br>
It does nothing with the data, it just formats it for printing.<br>
Feel free to look at the code of this page, download it, modify it.<br>
</p>
<p id="notice">Don't worry : NOTHING is sent to the Internet, you can disconnect from the network if you wish.</p>
<p class="biginfo">Please fill the following form, then print this page to backup your key data to paper.<br>
Make sure that you can read all characters on the printed
result, because in order to restore the key you will need to type
exactly all characters.
Especially, make sure that you can distinguish i,I,l,1 and
o,O,0.</p>
<form id="form" onsubmit="javascript:update();return false;">
<table>
<tbody><tr><td><label>Key alias</label></td><td><input value="foo@android" id="inkeyalias" onchange="javascript:update();" onkeydown="javascript:update();" type="text"></td>
</tr><tr><td><label>Comment</label></td><td><textarea id="incomment" type="text" onchange="javascript:update();" onkeydown="javascript:update();">Password : foobar<br>Enjoy !</textarea></td>
</tr><tr><td><label>Key data <span class="hint">(ex. PEM format)</span></label></td><td><textarea id="inkey" rows="27" cols="65" onchange="javascript:update();" onkeydown="javascript:update();">-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAXbjIm8OXPTuZ
P2Eou+Fr9FI5aj5knw4gM3QC3e2RRqLIqZeSOmChAs4i6NDeoqSk6ofdZMUiOGA7
mOelle6IjvAG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vIxNMwVhq3I/ym5cn7zve7V2mjmCfZJOUH1Te2Wp3TpmEv
CWm9JOd6GfjBgt+YfmuFxGk0sGIXmg7ZMQ7/RmKmgwCX68A27TEnP7yFaHoICIeB
55F1RSYgvZpN5Y8wfVsih3LGniLTzHpnItr4yLxZ7yAf0pM7KhNnHu11tQIDAQAB
oyEwHzAdBgNVHQ4EFgQU3zvhWFjxWoVAcyKyKYWEG3NnqvUwDQYJKoZIhvcNAQEL
BQADggEBAKpQ7rPL1ECDS3ctmut7Ng1TVFdlsc9XhnVUBfvBS9sG6WfDW3b6VVhC
WaC7SGGpKM+/62cVG09YEDZuTh5NzTrxCizcIeyr5ert1hwjeDIjojmW1Ejpsznl
F+GW4Jhtg6zrsCqJDeFUwxdfRBjdlA17gVVCT0nLS+/8GIN5kueJqcHiCmzT8x8q
VzR7EMquRMuEQbtvBSjth3eBEcCUGYsb1GVH6HVt1UKYwd0oeDygxIwS8awLGKJr
ynjxpg06Z/JzF9dz8aocPwOWLelXhoUuQpzg1hxzXyII6GcmkyV9jox64Cuyz0oZ
qEsMlDicsPdMaJs4Y5/yI1ZzTJMOD+g=
-----END CERTIFICATE-----</textarea></td></tr>
<tr><td colspan="2" style="text-align:center"><input value="Update" type="submit"></td></tr>
</tbody></table>
</form>
<span class="biginfo">The page will look like :</span>
<span class="smallinfo">Use the "print preview" feature of your browser to preview accurate rendering</span>
</div>
<!-- ONLY THIS PART WILL BE DISPLAYED / PRINTED -->
<!-- RECTO -->
<div id="page1" class="output">
<table style="width:100%">
<tbody><tr>
<td id="datatitle" style="width:100%"><h2><span style="display: none;" id="keyalias_def">Key backup</span><span id="keyalias">foo@android</span></h2><div id="date">Date : <span id="timestamp">Sat Jan 31 2015 15:45:59 GMT+0100 (CET)</span></div></td>
<td id="characterset" rowspan="3"><span class="title">Sample character set :</span><div class="data">ABCDEFGHIJKLMNOPQRSTUVWXYZ<br>abcdefghijklmnopqrstuvwxyz<br>1234567890+/</div></td>
</tr>
<tr>
<td id="datacomment">Password : foobar<br>Enjoy !</td>
</tr>
</tbody></table>
<div id="fontsize" class="hideme">change font size : <a href="javascript:increaseFontSize();" class="fontbutton">+</a> <a href="javascript:decreaseFontSize();" class="fontbutton">-</a></div>
<table id="keyframe">
<tbody><tr><td width="50%"></td><td><pre id="key" class="data">-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAXbjIm8OXPTuZ
P2Eou+Fr9FI5aj5knw4gM3QC3e2RRqLIqZeSOmChAs4i6NDeoqSk6ofdZMUiOGA7
mOelle6IjvAGd3G6MoxaYjUfKN2lEfZ1nAM+jQszDD8Ix2hKkzBlG0O8ZUe8+FVI
j8z0gccSKQJvlV+RX7Zexo43oxt7552fy8jE0zBWGrcj/KblyfvO97tXaaOYJ9kk
5QfVN7ZandOmYS8Jab0k53oZ+MGC35h+a4XEaTSwYheaDtkxDv9GYqaDAJfrwDbt
MSc/vIVoeggIh4HnkXVFJiC9mk3ljzB9WyKHcsaeItPMemci2vjIvFnvIB/Skzsq
E2ce7XW1AgMBAAECggEAS230oSUC4vDtx7+kd3aEg/I/s6fHY2lC/rluShl/qDGM
byag+oPNlBUng2TLUiFwcgJM2DFFY4+7nGLuom1SJVX3JHH9tEdR5bcQoXFCyBFt
FNziIMrpk1C//s9CQ8vHdD3mp58HLEAsINHSSiYBS0utWte1q6leN3egGIzqoACa
Mwd1A0Il/Kk4e0iLKawR6IdYfZLkRHK0x3osjQVK06jvhQyizCZtBJw8bOEGc/xc
2mAS1+OFj5hZ2DahD9OLS4y8e8A24UudUuqdQl90pUqIwepXG+KR1y2Tr7dKeCY/
K5YToXEFG7ovB4Bk1gVnFarRmUBM5KmOqDzF4AX0AQKBgQDe8CUJDDDYIF02fKtP
FHJi7xuvoMAJxspmiAW7V1/uA1llQUVcbAeG1fS+YF+d9UU8bQ6OcXeM5mWzuRJg
nrG+/myPC+DZ5pocIzJKQE7v3jd61RZW9os5sHNyMPsR44RtdY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BgNVBAcTCEZvbyBjaXR5MRkwFwYDVQQKExBGb28g
VGVjaG5vbG9naWVzMQswCQYDVQQLEwJJVDEPMA0GA1UEAxMGTS4gRm9vMIIBIjAN
BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwF24yJvDlz07mT9hKLvha/RSOWo+
ZJ8OIDN0At3tkUaiyKmXkjpgoQLOIujQ3qKkpOqH3WTFIjhgO5jnpZXuiI7wBndx
ujKMWmI1HyjdpRH2dZwDPo0LMww/CMdoSpMwZRtDvGVHvPhVSI/M9IHHEikCb5Vf
kV+2XsaON6Mbe+edn8vIxNMwVhq3I/ym5cn7zve7V2mjmCfZJOUH1Te2Wp3TpmEv
CWm9JOd6GfjBgt+YfmuFxGk0sGIXmg7ZMQ7/RmKmgwCX68A27TEnP7yFaHoICIeB
55F1RSYgvZpN5Y8wfVsih3LGniLTzHpnItr4yLxZ7yAf0pM7KhNnHu11tQIDAQAB
oyEwHzAdBgNVHQ4EFgQU3zvhWFjxWoVAcyKyKYWEG3NnqvUwDQYJKoZIhvcNAQEL
BQADggEBAKpQ7rPL1ECDS3ctmut7Ng1TVFdlsc9XhnVUBfvBS9sG6WfDW3b6VVhC
WaC7SGGpKM+/62cVG09YEDZuTh5NzTrxCizcIeyr5ert1hwjeDIjojmW1Ejpsznl
F+GW4Jhtg6zrsCqJDeFUwxdfRBjdlA17gVVCT0nLS+/8GIN5kueJqcHiCmzT8x8q
VzR7EMquRMuEQbtvBSjth3eBEcCUGYsb1GVH6HVt1UKYwd0oeDygxIwS8awLGKJr
ynjxpg06Z/JzF9dz8aocPwOWLelXhoUuQpzg1hxzXyII6GcmkyV9jox64Cuyz0oZ
qEsMlDicsPdMaJs4Y5/yI1ZzTJMOD+g=
-----END CERTIFICATE-----</pre></td><td width="50%"></td></tr>
<tr><td colspan="3"><div id="footer"><a href="http://nicolabs.github.io/printkey/">Find this tool at http://nicolabs.github.io/printkey</a></div></td></tr>
</tbody></table>
</div>
<!-- VERSO (INSTRUCTIONS) -->
<div id="page2" class="output">
<h2>How to restore this key</h2>
<p>To restore this key, type the characters from the frame into a text file that you will import into your key store.
Also include line breaks and '<i>BEGIN</i>' and '<i>END</i>' lines.</p>
<h3>Instructions for Java keystores</h3>
<h4>Restoring key from text file</h4>
<pre class="code">openssl pkcs12 -export -in foo-restored.pem -out foo-restored.p12
keytool -importkeystore -srckeystore foo-restored.p12 -srcstoretype pkcs12 -destkeystore restored.jks -deststoretype jks -srcalias 1 -destalias foorestored</pre>
<ul>
<li><tt>foo-restored.pem</tt> is the text file containing the data you typed. You can delete it afterwards.
</li><li><tt>foo-restored.p12</tt> is an intermediate file that can be also deleted afterwards.
</li><li><tt>restored.jks</tt> is the destination Java keystore where you want to import your restored key
</li><li><tt>foorestored</tt> is the alias of your restored key in the keystore
</li></ul>
<h4>Exporting key to readable text</h4>
<p>Follow those instructions if you want to backup another key.</p>
<pre class="code">keytool -importkeystore -srcstoretype jks -srcalias foo -deststoretype pkcs12 -srckeystore mykeys.jks -destkeystore foo.p12
openssl pkcs12 -in foo.p12 -out foo.pem -nodes</pre>
<ul>
<li><tt>foo</tt> is the alias of your key in the keystore
</li><li><tt>mykeys.jks</tt> is the Java keystore where to find the key
</li><li><tt>foo.p12</tt> is an intermediate file that can be deleted afterwards.
</li><li><tt>foo.pem</tt> contains key data as text. Print it.
</li></ul>
<h2>Useful links</h2>
<ul class="printlinks">
<li>Blog article and more detailed instructions : <a href="http://www.nicobo.net/articles/paper-backup-your-private-key">http://www.nicobo.net/articles/paper-backup-your-private-key</a>
</li><li>Keytool (install the latest JDK) : <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/keytool.html">http://docs.oracle.com/javase/7/docs/technotes/tools/windows/keytool.html</a>
</li><li>OpenSSL (docs and binaries) : <a href="http://www.openssl.org/docs/apps/openssl.html">http://www.openssl.org/docs/apps/openssl.html</a>
</li><li>KeyStore Explorer (GUI) : <a href="http://www.lazgosoftware.com/kse/index.html">http://www.lazgosoftware.com/kse/index.html</a>
</li><li>The GNU Privacy Guard : <a href="http://www.gnupg.org/gph/en/manual.html">http://www.gnupg.org/gph/en/manual.html</a>
</li><li>Introduction to PGP : <a href="http://www.pgpi.org/doc/pgpintro">http://www.pgpi.org/doc/pgpintro</a>
</li><li>Tesseract - an open source OCR software : <a href="http://code.google.com/p/tesseract-ocr">http://code.google.com/p/tesseract-ocr</a>
</li><li><a href="http://en.wikipedia.org/wiki/Paper_key">http://en.wikipedia.org/wiki/Paper_key</a>
</li><li>Paperkey - an OpenPGP key archiver : <a href="http://www.jabberwocky.com/software/paperkey/">http://www.jabberwocky.com/software/paperkey</a>
</li><li>Safeberg's ® Trusted Paper Key : <a href="http://www.safeberg.com/en/howitworks/usagetrustedpaperkey">http://www.safeberg.com/en/howitworks/usagetrustedpaperkey</a>
</li></ul>
</div>
</body></html>