Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //////////////////////////////////////////////////////
- // Uppbyggt & Utvecklat av Joel & Linus - 2010/2011 //
- // Alla Rättigheter Reserverade //
- //////////////////////////////////////////////////////
- // slumpa salt
- function generateSalt($length=32) {
- $pass = "";
- $possible = "#R1½xÄ!¤%©¥#G%R¤U&#¤%&#!=/½x<€#!½Ð½l9+¦e:&%¤/=Ð#&g+ä:&%¤#¤/=Ð#&g+äLZ3&!½xD[ÊϦe:hjhh=xD<€#!½Ð½kl+[jh";
- $i = 0;
- while ($i < $length) {
- $char = substr($possible, mt_rand(0, strlen($possible) - 1), 1);
- if (!strstr($pass, $char)) {
- $password .= $char;
- $i++;
- }
- }
- return $pass;
- }
- // Salta lösenordet
- function safepass($password)
- {
- $username = strtolower($_POST['user']);
- $salt = "$pass";
- $dynSalt = hash('sha512', $pass.$username.$password.$salt);
- return $dynSalt;
- }
- $passw = safepass($password);
- echo $passw.y.$passw.a.$passw.t.$passw.z.$passw.y.$passw;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement