在PHPMyAdmin上更改哈希密码(Change a hashed password on PHPMyAdmin)

编程入门 行业动态 更新时间:2024-10-26 22:27:52
在PHPMyAdmin上更改哈希密码(Change a hashed password on PHPMyAdmin)

我想通过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.

更多推荐

本文发布于:2023-07-19 22:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1187972.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密码   PHPMyAdmin   Change   password   hashed

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!