Skip to content

Instantly share code, notes, and snippets.

@gwinans
Created April 28, 2016 18:59
Show Gist options
  • Save gwinans/b98488cfb0aaea0b29efcf96f256a8c8 to your computer and use it in GitHub Desktop.
Save gwinans/b98488cfb0aaea0b29efcf96f256a8c8 to your computer and use it in GitHub Desktop.
MySQL Password Hash Generator
<html>
<head>
<title>MySQL Password Hash Generator</title>
</head>
<body>
<?php
if ( isset($_POST['pass1']) AND isset($_POST['pass2']) ):
$pass = ($_POST['pass1'] === $_POST['pass2']) ? $_POST['pass1'] : FALSE;
if ( $pass === FALSE ):
echo 'Passwords do not match.<br /><br />';
else:
echo 'Send the following string to Geoff Winans:<br /><br />';
echo '<input type="text" value="*'.strtoupper(sha1(sha1($pass, true))).'" style="width: 350px" disabled /><br /><br />';
endif;
endif
?>
<form method='post' action='hash.php'>
<table>
<tr>
<td align="right">Pass:</td> <td><input type='password' name='pass1' /></td>
</tr>
<tr>
<td>Confirm Pass:</td> <td><input type='password' name='pass2' /></td>
</tr>
<tr>
<td>&nbsp;</td><td align="right"><input type='submit' value='Submit'></td>
</tr>
</table>
</form>
<body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment