-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakecode.php
40 lines (39 loc) · 1006 Bytes
/
makecode.php
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
<?php
$error = false;
$md5 = false;
$code = "";
if ( isset($_GET['code']) ) {
$code = $_GET['code'];
if ( strlen($code) != 2 ) {
$error = "Input must be exactly four digits";
} else if ( $code[0] < "0" || $code[0] > "9" ||
$code[1] < "0" || $code[1] > "9" ) {
$error = "Input must only be the numbers 0-9";
} else {
$md5 = hash('md5', $code);
}
}
?>
<!DOCTYPE html>
<head><title>Charles Severance PIN Code</title></head>
<body>
<h1>MD5 PIN Maker</h1>
<?php
if ( $error !== false ) {
print '<p style="color:red">';
print htmlentities($error);
print "</p>\n";
}
if ( $md5 !== false ) {
print "<p>MD5 value: ".htmlentities($md5)."</p>";
}
?>
<p>Please enter a two-letter key for encoding.</p>
<form>
<input type="text" name="code" value="<?= htmlentities($code) ?>"/>
<input type="submit" value="Compute MD5 for CODE"/>
</form>
<p><a href="makecode.php">Reset</a></p>
<p><a href="index.php">Back to Cracking</a></p>
</body>
</html>