-
Notifications
You must be signed in to change notification settings - Fork 21
/
statistics.html
130 lines (107 loc) · 5.89 KB
/
statistics.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
<!DOCTYPE html>
<html>
<head>
<title>Password Score</title>
<link rel="stylesheet" type="text/css" href="docs/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="docs/css/prettify.css">
<script type="text/javascript" src="docs/js/jquery.js"></script>
<script type="text/javascript" src="docs/js/prettify.js"></script>
<script type="text/javascript" src="dist/js/password-score.js"></script>
<script type="text/javascript" src="dist/js/password-score-options.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML'></script>
<script type="text/javascript">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
$(document).ready(function() {
window.prettyPrint() && prettyPrint();
});
</script>
</head>
<body>
<a href="https://github.com/davidstutz/password-score"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
<div class="container">
<h1>Password Score</h1>
<hr>
<ul class="nav nav-pills">
<li><a href="index.html">Demo</a></li>
<li class="active"><a href="#">Statistics</a></li>
<li><a href="api.html">API</a></li>
<li><a href="docs.html">Documentation</a></li>
<li><a href="tests/SpecRunner.html" target="_blank">Tests</a></li>
</ul>
<hr>
<p class="alert alert-info">
Use the form below to select a password list and click Calculate! to get some statistics. <b>Depending on the chosen password list this may take some <u>really long time</u></b> - eventually crashing your browser.
</p>
<p class="alert alert-warning">
Note that the progress is currently only shown in the console!
</p>
</div>
<div class="stripe">
<div class="container">
<div class="input-group">
<select class="form-control" id="password-list">
<option value="cain.json">cain.txt</option>
<option value="hotmail.json" selected>hotmail.txt</option>
<option value="john.json">john.txt</option>
<option value="myspace.json">myspace.txt</option>
<option value="phpbb.json">phpbb.txt</option>
</select>
<span class="input-group-btn">
<button class="btn btn-primary" id="password-list-calculate" type="button">Calculate!</button>
</span>
</div>
</div>
</div>
<div class="container">
<script type="text/javascript">
$(document).ready(function() {
$('#password-list-calculate').on('click', function() {
$(this).attr('disabled', true);
var list = $('#password-list').val();
var password_lists = [
'cain.json',
'hotmail.json',
'john.jsom',
'myspace.json',
'phpbb.json'
];
if (password_lists.indexOf(list) >= 0) {
$.when($.getJSON('data/passwords/json/' + list)).then(function(passwords) {
var sum = 0;
var count = 0;
var width = 0.0;
for (var i = 0; i < passwords.length; i++) {
var score = new Score(passwords[i]);
var entropy = score.calculateEntropyScore();
var percentage = (1.0*i)/passwords.length;
var width_percentasge = (width + 1.0)/100;
console.log(percentage + ' - ' + passwords[i] + ': ' + entropy);
if (isFinite(entropy)) {
sum += entropy;
count++;
}
}
$('#password-list-result-headline').text('Average Score');
$('#password-list-result').text(sum/count);
});
}
$(this).attr('disabled', false);
});
});
</script>
<div id="password-list-result-headline" style="font-size:36px;text-align:center;">
</div>
<div id="password-list-result" style="font-size:72px;text-align:center;">
</div>
</div>
<hr>
<div class="container">
<p>
© 2013 - 2018
<a href="http://davidstutz.de">David Stutz</a> - <a href="http://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause License</a> - <a href="https://davidstutz.de/impressum/">Impressum</a> - <a href="https://davidstutz.de/datenschutz/">Datenschutz</a>
</p>
</div>
</body>
</html>