-
Notifications
You must be signed in to change notification settings - Fork 8
/
mkpasswd.php
39 lines (31 loc) · 889 Bytes
/
mkpasswd.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
<html>
<body>
<h1>uxpanel mkpasswd</h1>
<?php
include("include/common.php");
include("include/pbkdf2.php");
if(isset($_REQUEST['password'])) {
$password = $_REQUEST['password'];
$format = "pbkdf2";
if(isset($_REQUEST['format'])) {
if($_REQUEST['format'] == "hash") $format = "hash";
else if($_REQUEST['format'] == "plain") $format = "plain";
}
if($format == "pbkdf2") {
$password = pbkdf2_create_hash($password);
} else if($format == "hash") {
$password = chash($password);
}
echo "<p>mkpasswd result: $password</p>";
}
?>
<form method="POST" action="mkpasswd.php">
Password: <input type="password" name="password" />
<br />Format: <select name="format">
<option value="pbkdf2">PBKDF2 (recommended)</option>
<option value="hash">SHA-512</option>
<option value="plain">Plain text</option>
<br /><input type="submit" value="mkpasswd" />
</form>
</body>
</html>