-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththe_index.html
More file actions
148 lines (112 loc) · 3.98 KB
/
the_index.html
File metadata and controls
148 lines (112 loc) · 3.98 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX">
<META NAME="ROBOTS" CONTENT="NOFOLLOW">
<title>SHA1_Pass v1.7</title>
<body>
<h1>SHA1_Pass v1.7</h1>
<form name="sha1_pass_form">
Sentence<input id="sentence" type="password" title="Type a sentence" maxlength=128 size="18">
Word<input id="word" type="password" title="Type a word" maxlength=128 size="18">
<br>
<input type="checkbox" id="HMAC" title="Generate HMAC-SHA1 hashes rather than plain SHA1 hashes" name="HMAC"> HMAC
<input type="checkbox" id="Complex" title="Add the string '.H0k' to the end of the password" name="Complex"> Complex
<input type="button" title="Clear password, all fields and uncheck all checkboxes" value="Clear All" onClick="Clear_All()">
<br>
<input type="button" title="Generate Hex encoded password" value="Hex" onclick="derive_hex()">
<input type="button" title="Generate Hex Half encoded password" value="Hex Half" onclick="derive_hex_half()">
<input type="button" title="Generate Base64 encoded password" value="B64" onclick="derive_b64()">
<input type="button" title="Generate Base64 Half encoded password" value="B64 Half" onclick="derive_b64_half()">
</form>
<div id="result" style="background-color:black;color:black;width:458px"></div>
<script src="sha1.js"></script>
<script>
var complex_string = ".H0k";
var timeout_period = 15000;
var to = 0;
function Clear()
{
document.getElementById("result").innerHTML = "";
}
function Clear_All()
{
document.sha1_pass_form.sentence.value = "";
document.sha1_pass_form.word.value = "";
document.sha1_pass_form.HMAC.checked = 0;
document.sha1_pass_form.Complex.checked = 0;
document.getElementById("result").innerHTML = "";
}
function display_message(hash, size)
{
if ( size.toLowerCase() == "half" )
{
if ( document.sha1_pass_form.Complex.checked )
document.getElementById("result").innerHTML = hash.substring(0,hash.length/2).trim() + complex_string;
else
document.getElementById("result").innerHTML = hash.substring(0,hash.length/2).trim();
}
else
{
if ( document.sha1_pass_form.Complex.checked )
document.getElementById("result").innerHTML = hash.trim() + complex_string;
else
document.getElementById("result").innerHTML = hash.trim();
}
to = setTimeout( "Clear()", timeout_period );
}
function derive_hex()
{
clearTimeout(to);
var sentence = document.sha1_pass_form.sentence.value;
var word = document.sha1_pass_form.word.value;
// Sanity checks
if (!sentence || !word)
return;
if ( document.sha1_pass_form.HMAC.checked )
display_message( hex_hmac_sha1(sentence + word, "SHA1_Pass"), "full" );
else
display_message( hex_sha1(sentence + word), "full" );
}
function derive_hex_half()
{
clearTimeout(to);
var sentence = document.sha1_pass_form.sentence.value;
var word = document.sha1_pass_form.word.value;
// Sanity checks
if (!sentence || !word)
return;
if ( document.sha1_pass_form.HMAC.checked )
display_message( hex_hmac_sha1(sentence + word, "SHA1_Pass"), "half" );
else
display_message( hex_sha1(sentence + word), "half" );
}
function derive_b64()
{
clearTimeout(to);
var sentence = document.sha1_pass_form.sentence.value;
var word = document.sha1_pass_form.word.value;
// Sanity checks
if (!sentence || !word)
return;
if ( document.sha1_pass_form.HMAC.checked )
display_message( b64_hmac_sha1(sentence + word, "SHA1_Pass"), "full" );
else
display_message( b64_sha1(sentence + word), "full" );
}
function derive_b64_half()
{
clearTimeout(to);
var sentence = document.sha1_pass_form.sentence.value;
var word = document.sha1_pass_form.word.value;
// Sanity checks
if (!sentence || !word)
return;
if ( document.sha1_pass_form.HMAC.checked )
display_message( b64_hmac_sha1(sentence + word, "SHA1_Pass"), "half" );
else
display_message( b64_sha1(sentence + word), "half" );
}
</script>
</body>
</html>