-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
58 lines (55 loc) · 1.49 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
<head>
<title>yubitell - identify a yubikey</title>
</head>
<style>
body {
font-family: sans-serif;
font-size: 110%;
}
</style>
<h1>YubiTell</h1>
<p>
You are no one to me at the moment. "Accidentally" touch your YubiKey now.
If nothing happens, that means you're safe. Otherwise, your YubiKey serial number will be shown.
</p>
<p>
<a href="https://github.com/ssg/yubitell">Source</a>
</p>
<p>
<a href="https://medium.com/@ssg/avoid-leaking-your-identity-with-yubikey-92539b6608a">What is this?</a>
</p>
<script>
(function () {
"use strict";
function decodeModHex(str) {
var src = "cbdefghijklnrtuv";
var dst = "0123456789abcdef";
var out = "";
for (var i = 0; i < str.length; i++) {
var c = str[i];
var p = src.indexOf(c);
if (p < 0) {
return null;
}
out += dst.charAt(p);
}
return out;
}
var captured = "";
var input = document.getElementsByTagName("input")[0];
var p = document.getElementsByTagName("p")[0];
document.onkeypress = function (e) {
captured += e.key;
if (captured.length > 11) {
var parsed = decodeModHex(captured.substring(0, 12));
if (!parsed) {
captured = "";
return;
}
var id = parseInt(parsed, 16);
p.innerHTML = "Your YubiKey serial number is #<b>" + id.toString() + "</b> - I will never forget you! (jk, but I could have stored that information if I wanted to)";
document.onkeypress = null;
}
}
})();
</script>