-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
74 lines (59 loc) · 2.63 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
<!DOCTYPE html>
<html>
<head>
<title>Abbrase.js</title>
<script src="abbrase.js"></script>
<style type="text/css">
body { background-color: #222; color: #ccc; font-family: sans-serif; }
pre { border: 1px solid #888; padding: 10px; overflow-x: auto; }
a { color: #44f; }
#content { width: 800px; margin: auto;}
#wordcount { width: 3em; }
</style>
</head>
<body>
<a href="https://github.com/rmmh/abbrase"><img style="position: absolute; top: 0; left: 0; border: 0;" src="forkme.png"></a>
<div id="content">
<h1>Abbrase</h1>
Password generation using abbreviated phrases<br><br>
<input type="button" onclick="newbatch();" value="Generate"> passwords using
<input id="wordcount" type="number" min="1" max="100" value="5" onchange="newbatch();"> word phrases.
<pre id="output"></pre>
<h2>How does this work?</h2>
First, <span id="explain_count"></span> secure random numbers are generated. Each number ranges from 0-1023, giving 10 bits of entropy.
<pre id="explain_numbers"></pre>
Each number is converted into a three letter abbreviation. The password is made by joining them together. Abbreviations are taken from a pool of the 1024 most common English word prefixes.
<pre id="explain_password"></pre>
Finally, a phrase is found that abbreviates to the password. Words that are normally found together are chosen to make the phrase more memorable.
<pre id="explain_mnemonic"></pre>
The mnemonic is much easier to remember than the input numbers, but equally secure!<br>
<br>
All steps are performed locally in your browser, and not sent to any other server. For more security, try the Python or C versions in the Abbrase <a href="https://github.com/rmmh/abbrase">github repository</a>.
</div>
<script type="text/javascript">
var graph = new WordGraph("wordlist_bigrams.txt");
var generator = new PassphraseGenerator(graph);
function setTextContent(id, text) {
document.getElementById(id).textContent = text;
}
graph.onprogress = function(perc) {
if (perc < 0)
setTextContent("output", "Error downloading: HTTP Error " + -perc);
else
setTextContent("output", "Downloading 20MB word list... " + perc + "% done");
}
graph.onprogress(0);
function newbatch() {
var length = parseInt(document.getElementById("wordcount").value) || 5;
var example_password = generator.gen_password(length);
setTextContent("explain_count", length);
setTextContent("explain_numbers", pretty_arraybuffer(example_password.numbers));
setTextContent("explain_password", example_password.password);
setTextContent("explain_mnemonic", example_password.mnemonic);
setTextContent("output", generator.make_table(length, 32));
}
graph.onready = newbatch;
graph.load();
</script>
</body>
</html>