Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Put this in hash.php or what ever.
- <?
- session_start ();
- $password = ($_POST['password']);
- $length = 32;
- ?>
- <?
- $salt1 = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);
- $salt2 = base64_encode(mcrypt_create_iv(ceil(0.15*$length), MCRYPT_DEV_URANDOM));
- function doubleSalt($salt1,$salt2){
- $password = str_split($toHash,(strlen($toHash)/2)+1);
- var_dump($password);
- $hash = hash('whirlpool', $salt1.$password[0].$salt2.$password[1]);
- return $hash;
- }
- echo '</br>';
- echo $hash;
- session_write_close ();
- ?>
- //Put this on one page, index.php, etc.
- <p>Enter A Password</p>
- <form action="hash.php" method="post"><input type="text" name="password">
- </br>
- <input type="submit"></form>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement