Skip to content

Instantly share code, notes, and snippets.

@anvyst
Created January 25, 2013 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anvyst/4636845 to your computer and use it in GitHub Desktop.
Save anvyst/4636845 to your computer and use it in GitHub Desktop.
<?php
$password = 'admin';
for ($i=0; $i<=32; $i++) {
$d=rand(1,30)%2;
$salt .= $d ? chr(rand(65,90)) : chr(rand(48,57));
}
$hashed = md5($password . $salt);
$encrypted = $hashed . ':' . $salt;
print "Result: $encrypted\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment