我想通过PHPMyAdmin更改帐户的密码,但密码都是加密的。 尝试通过应用程序更改帐户密码时出错,所以如果可能的话我会在这里做。
这是密码的代码:
$salt = $this->create_salt_password($username); $hash = $salt . $password; for ( $i = 0; $i < 100000; $i ++ ) { $hash = hash('sha256', $hash); } $hash = $salt . $hash;和:
define('AUTH_SALT','wcRwGxDzULe?s3J%R^W@9)r}xfXpESul5hC,z^ze.oz*1E|ys,Bk,:Q/z_I&M9..');我正在尝试使用sha1-online.com首先重新创建目前存储在数据库中的哈希。
密码存储为:
6b68f3c4d174fa0a8163db9fc9abdd81a75f9186a95c686039acaa4ac1d99f75dd0f838e6eb30412121e228bc4008d446d4ad24b3748beed7a28de3d78999122
而作为一个字符串只是password123
盐法:
public function create_salt_password($username) { /** Creates a hash value for the password using a prefixed random unique identifier value with a static characters and the username */ $salt = hash('sha256', uniqid(mt_rand(), true) .AUTH_SALT .strtolower($username)); return $salt; }I want to change the password of an account through PHPMyAdmin, but the passwords are all encrypted. I get an error when trying to change the password of the account through the applicaiton so I will do it here instead if possible.
Here is the code for the password:
$salt = $this->create_salt_password($username); $hash = $salt . $password; for ( $i = 0; $i < 100000; $i ++ ) { $hash = hash('sha256', $hash); } $hash = $salt . $hash;And:
define('AUTH_SALT','wcRwGxDzULe?s3J%R^W@9)r}xfXpESul5hC,z^ze.oz*1E|ys,Bk,:Q/z_I&M9..');I am trying to use sha1-online.com to first of all re-create the hash which is stored on the database at the moment.
The password is stored as:
6b68f3c4d174fa0a8163db9fc9abdd81a75f9186a95c686039acaa4ac1d99f75dd0f838e6eb30412121e228bc4008d446d4ad24b3748beed7a28de3d78999122
and as a string is just password123
salt method:
public function create_salt_password($username) { /** Creates a hash value for the password using a prefixed random unique identifier value with a static characters and the username */ $salt = hash('sha256', uniqid(mt_rand(), true) .AUTH_SALT .strtolower($username)); return $salt; }最满意答案
以下可能(如果我们没有遗漏任何代码)帮助您重新创建工作传递:
$username = 'sweetest_viv'; $password = 'password123'; $staticsalt = 'wcRwGxDzULe?s3J%R^W@9)r}xfXpESul5hC,z^ze.oz*1E|ys,Bk,:Q/z_I&M9..'; $salt = hash('sha256', uniqid(mt_rand(), true) .$staticsalt.strtolower($username)); $hash = $salt . $password; for ( $i = 0; $i < 100000; $i ++ ) { $hash = hash('sha256', $hash); } $hash = $salt . $hash; echo 'Salt: ' . PHP_EOL . $salt; echo PHP_EOL.PHP_EOL; echo 'Hash: ' . PHP_EOL . $hash ;尝试存储来自http://codepad.org/rBfS6wEJ的哈希。
The following will probably (if we're not missing any code) help you recreate a working pass:
$username = 'sweetest_viv'; $password = 'password123'; $staticsalt = 'wcRwGxDzULe?s3J%R^W@9)r}xfXpESul5hC,z^ze.oz*1E|ys,Bk,:Q/z_I&M9..'; $salt = hash('sha256', uniqid(mt_rand(), true) .$staticsalt.strtolower($username)); $hash = $salt . $password; for ( $i = 0; $i < 100000; $i ++ ) { $hash = hash('sha256', $hash); } $hash = $salt . $hash; echo 'Salt: ' . PHP_EOL . $salt; echo PHP_EOL.PHP_EOL; echo 'Hash: ' . PHP_EOL . $hash ;Try storing the hash from http://codepad.org/rBfS6wEJ.
更多推荐
发布评论