Password in md5 decrypted to English (PHP MYSQL) [duplicate]

≯℡__Kan透↙ 提交于 2020-01-06 19:44:39

问题


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


回答1:


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




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/43339944/password-in-md5-decrypted-to-english-php-mysql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!