Skip to content

Instantly share code, notes, and snippets.

@nssy
Last active August 29, 2015 14:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nssy/50cbbbe23c16804c47e9 to your computer and use it in GitHub Desktop.
Save nssy/50cbbbe23c16804c47e9 to your computer and use it in GitHub Desktop.
Hash Creator (PHP)
<?php
$string = isset($_POST['string']) ? $_POST['string'] : null;
$selected_algo = isset($_POST['algo']) ? $_POST['algo'] : null;
if (!empty($string) && !empty($selected_algo ))
{
if (in_array($selected_algo, hash_algos())) {
echo 'The ',$selected_algo, ' for ( <b>', $string, '</b> ) is => ', hash($selected_algo, $string, false);
} else {
echo 'Hash Method no supported';
}
} else {
echo 'Please enter your Raw text';
$selected_algo = 'sha1';
}
?>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Hash Creator</title>
<script>
window.onload = function() {
var input = document.getElementById("raw-string").focus();
}
</script>
</head>
<body>
<form action="#" method="post">
<label for="string">Enter the String: </label>
<input type="text" id="raw-string" name="string" value="<?=$string?>" style="color:white;background:#001;" tabindex="1" autofocus/>
<select name="algo" size="1">
<?php foreach ( hash_algos() as $key => $algo):?>
<option value="<?=$algo?>" <?php if($selected_algo===$algo) echo 'selected=""';?>>
<?=$algo?>
</option>
<?php endforeach?>
</select>
<button type="submit" class="btn theme-btn">Go</button>
</form>
<div class="more"><a href="https://crackstation.net/" target="_blank">Checkout Hash reversal here</a></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment