-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
78 lines (60 loc) · 2.39 KB
/
Copy pathindex.html
File metadata and controls
78 lines (60 loc) · 2.39 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<title>GPG/PGP Key to QR Code converter</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="qrcodejs/jquery.min.js"></script>
<script type="text/javascript" src="qrcodejs/qrcode.js"></script>
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
margin: 20px;
}
.qrcodebox {
display: inline-block;
margin: 15px;
text-align:center;
}
input, textarea {
width:100%;
}
thead { display: table-header-group; }
tfoot { display: table-footer-group; }
</style>
</head>
<body>
<div id="input">
<h1>GPG Key 2 QR Code</h1>
This tool will convert your GPG key (or any other arbitrary ascii data) to QR codes. To restart and enter new data, simply refresh the page.<br><br>
Paste your private key here. There is no need to paste your public key as well, as you private key already contains a copy of it.<br>
<input type="text" placeholder="Name of the key (choose whatever you want)" id="title"><br>
<textarea id="text" cols="150" rows="20" placeholder="Your GPG Key"></textarea><br>
<input type="button" value="Generate!" id="generate">
</div>
<script type="text/javascript">
var qrcode=[];
function makeCode () {
var elText = document.getElementById("text");
if (elText.value) {
$('#input').hide();
var pieces=elText.value.match(/(.|[\r\n]){1,1200}/g);
$('body').append('<h1>'+$('#title').val()+'</h1>');
$('body').append('<small>To reassemble just scan one code after another and concat the resulting strings</small>');
$('body').append('<tbody></tbody>');
for(var i=0;i<pieces.length;i++){
$("tbody").append('<div class="qrcodebox"><span id="qrcode'+i+'" style="width:500px; height:500px; margin-top:15px;"></span>'+$('#title').val()+' - '+(i+1)+' of '+pieces.length+'</div>');
qrcode[i]=new QRCode(document.getElementById("qrcode"+i), {
width : 400,
height : 400,
correctLevel : QRCode.CorrectLevel.H
});
qrcode[i].makeCode(pieces[i]);
}
}
}
$("#generate").
on("click", function () {
makeCode();
});
</script>
</body>