forked from ConradIrwin/gpg-decoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (61 loc) · 3.21 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
<!doctype html>
<meta charset="utf-8"/>
<script src="base64.js"></script>
<script src="hex.js"></script>
<script src="stream.js"></script>
<script src="decode.js"></script>
<style>
table { font-family: monospace; }
textarea { font-family: monospace; padding: 1rem; }
body, table { width: 100%; box-sizing: border-box; margin: 0; border: 10px solid white; }
pre { white-space: pre-wrap; }
.hovered { background: #CCC; }
.bytes span { font-weight: bold; padding-left: 10px; }
td { vertical-align: top; padding: 0.5em; }
.details { word-break: break-word; }
p { margin: 0.75em; max-width: 800px }
</style>
<h1>GPG/PGP Decoder</h1>
<p>This page will decode PGP armored messages in javascript. It's intended to help you debug if you happen to be working with <a href="https://tools.ietf.org/html/rfc4880">RFC 4880</a> encoded messages. I built it while making <a href="https://github.com/ConradIrwin/dotgpg">dotgpg</a> and it was inspired by (and shares code from) the awesome <a href="http://lapo.it/asn1js/">ASN.1 decoder</a>.</p>
<p>To use it, just paste a GPG message in the box below and click Decode. On the left of the page you'll see the actual bytes, and on the right of the page is the assigned meaning.</p>
<p style="margin-left: 5em; margin-bottom: 1.5em;">— <a href="https://twitter.com/ConradIrwin">@ConradIrwin</a> (<a href="https://github.com/ConradIrwin/gpg-decoder">source code</a>)</p>
<p>
<textarea rows="25" cols="62" spellcheck=false>
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.15 (Darwin)
hQEMA9RCnscN9OmNAQf+M72U4c2l2zqZfwqVCTIEi/7HmwZihTricXFI8Cs1L0sV
Ab7WH5uj7UPhO+ZEoPqgxi2Geb1G7qquv4NYDSLSX/cG3MdBkw2MtxPtzUjuiLNh
5UQkl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5e65JNPx3y1qPC+IeZcF8okNsj9kl3r7dmAKj7VgIjo4DdWe2n
ibU7sg==
=HprM
-----END PGP MESSAGE-----
</textarea>
<input type="submit" value="Decode" style="display: block" onclick="decode(document.getElementsByTagName('textarea')[0].value); return false">
</p>
<table>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
<script>
if (this.location.hash.length > 1) {
document.getElementsByTagName('textarea')[0].value = unescape(this.location.hash.substr(1));
decode(document.getElementsByTagName('textarea')[0].value);
}
</script>