Password in md5 decrypted to English (PHP MYSQL) [

2019-09-13 20:18发布

This question already has an answer here:

I have password stored in database and its showing on browser as md5 because its saved there as md5

below is the code am using

$result=$link->query("select * from adminpanel");

echo "<tr><th>User Name</th><th>Password</th></tr>";

// loop through results of database query, displaying them in the table

while($row =mysqli_fetch_array($result,MYSQLI_ASSOC)) {
// foreach( $result as $row ) { 



// echo out the contents of each row into a table

echo "<tr>";

echo '<td>' . $row['username'] . '</td>';

echo '<td>' . $row['password'] . '</td>';

It is showing me user name and password in a table against each user but password I want to show in ENGLISH. Decrypted value

Possible?

Please guide

Thanks

标签: php mysqli md5
3条回答
成全新的幸福
2楼-- · 2019-09-13 20:44

MD5 is a cryptographic hash function. The very point of these functions is that you cannot reverse them. That is: you cannot "decrypt" the password from the MD5 sum.

The way these are used for passwords is to hash the password that the user entered and compare that hash with the one you stored in your database. But MD5 is actually not well-suited for this, as you can easily get a password that produces the same hash using a rainbow table. At least add some salt.

查看更多
小情绪 Triste *
3楼-- · 2019-09-13 20:48

md5 is a hash; you can't "undo" an md5 encryption

查看更多
干净又极端
4楼-- · 2019-09-13 20:50

Hashing is a one-way operation, meaning it cannot be decrypted. Simply you can not decrypt the MD5 encrypted value. If in your case you need it then you can use any other two-way operation for password.

查看更多
登录 后发表回答