-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
135 lines (125 loc) · 5.03 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
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
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<title>PassCheck - Some handy password tools.</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<br>
<div class="wrap text-center">
<body>
<center>
<img src="images/passcheck.png" alt="PassCheck logo" style="width:160px;height:150px;">
<br>
<font size=6>
PassCheck
</font>
<br>
Some handy password tools.
</center>
<hr>
<body>
<p class="head">Generator:</p>
<form action="" name="passGen">
<input type="text" name="length" size="3" value="" placeholder="Specify length..." class="input">
<br><br>
<input type="text" name="output" size="18" placeholder="Password will generate here..." class="output">
<br><br>
<input type="button" value="Generate" onclick="populate(this.form.length.value)"/>
</form>
</main>
<script src="js/generator.js"></script>
</body>
<hr>
<p class="head">Strength checker:</p>
</head>
<body>
<input id="password-box" placeholder="Enter password..." type="password" />
<div id="password-time" class="hsimp-time"></div>
<ul id="password-checks" class="hsimp-checks"></ul>
<script src="js/hsimp.min.js"></script>
<script>
(function (doc) {
var passwordInput = doc.getElementById("password-box"),
timeDiv = doc.getElementById("password-time"),
checksList = doc.getElementById("password-checks");
// Code to render the time returned by HSIMP
var renderTime = function (time, input) {
timeDiv.innerHTML = time || "";
};
// Code to output the checks returned by HSIMP
var renderChecks = function (checks, input) {
checksList.innerHTML = "";
for (var i = 0, l = checks.length; i < l; i++) {
var li = doc.createElement("p"),
title = doc.createElement("h4"),
message = doc.createElement("blockquote");
title.innerHTML = checks[i].name;
li.appendChild(title);
message.innerHTML = checks[i].message;
li.appendChild(message);
checksList.appendChild(li);
}
};
// Setup the HSIMP object
var attachTo = hsimp({
options: {
calculationsPerSecond: 10e9, // 10 billion calculations per second
good: 31557600e9, // 1 billion years
ok: 31557600e3 // 1 thousand years
},
outputTime: renderTime,
outputChecks: renderChecks
});
// setup custom values for "instantly"/"forever"
hsimp.setDictionary({
"instantly": "Immediately",
"forever": "Until the end of time, probably",
});
// Run the HSIMP
attachTo(passwordInput);
}(this.document));
</script>
</body>
<hr>
<p class="head">Breach checker:</p>
<form id="passForm" action="#">
<input type="password" placeholder="Enter password..." id="password" />
<br>
<br>
<input type="submit" value="Check" id="submitPass"/>
</form>
<div id="result"></div>
</body>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/pwned.js" ></script>
<script>
let passwordInput = document.getElementById("password");
let resultTarget = document.getElementById("result");
let submitInput = document.getElementById("submitPass");
let passwordChecker = new HIBP.HibpPassword(function(hash,count){
resultTarget.innerHTML = '<br> <blockquote>Your password has been found in <b>'+count+'</b> data breaches. For more information, visit <a href="https://www.haveibeenpwned.com">haveibeenpwned.com.</a>';
});
$("#passForm").submit(function(){
let password = passwordInput.value;
if(typeof password !== 'undefined' && password != ''){
passwordChecker.GetPasswordOccurences(password);
}
return false;
});
</script>
<hr>
<center>
<font size="1">
This site is for educational use. Entered passwords are not logged.
<br>
<a href="https://github.com/atentumzero/PassCheck">Source code and license information.</a> - <a href="mailto:[email protected]">Contact</a>
</font>
</center>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
</html>