Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include "inc/core.php"; ?>
- <form method='post'><input type='submit' name='submitPasses' value='Update Password Encryption' /></form>
- <?php
- if (isset($_POST['submitPasses'])) {
- $grabusers = $_SQL->query("SELECT * FROM users") or die($_SQL->error);
- $users = $grabusers->fetch_assoc();
- foreach ($users as $user) {
- $salt = md5(rand(1,999999) * microtime());
- $saltPLUSpass = $salt . $user['password'];
- echo "Pass: ".$user['password']."<br />";
- echo "Salt: ".$salt."<br /><br />";
- $saltNpass = sha512($saltPLUSpass);
- // $_SQL->query("update users set sodium='".$salt."', password='".$saltNpass."' where id='".$user['id']."'") or die($_SQL->error);
- echo "passwords and salts have been applied successfully";
- }
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment