Advertisement
JudeAustin

r3wt

Oct 11th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. //Put this in hash.php or what ever.
  2. <?
  3. session_start ();
  4. $password = ($_POST['password']);
  5. $length = 32;
  6. ?>
  7. <?
  8. $salt1 = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);
  9. $salt2 = base64_encode(mcrypt_create_iv(ceil(0.15*$length), MCRYPT_DEV_URANDOM));
  10. function doubleSalt($salt1,$salt2){
  11. $password = str_split($toHash,(strlen($toHash)/2)+1);
  12. var_dump($password);
  13. $hash = hash('whirlpool', $salt1.$password[0].$salt2.$password[1]);
  14. return $hash;
  15. }
  16. echo '</br>';
  17. echo $hash;
  18. session_write_close ();
  19. ?>
  20.  
  21. //Put this on one page, index.php, etc.
  22. <p>Enter A Password</p>
  23. <form action="hash.php" method="post"><input type="text" name="password">
  24. </br>
  25. <input type="submit"></form>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement