java - 32位的MD5的加密码 怎么还原成原来的String字符串
PHP中文网
PHP中文网 2017-04-18 09:40:41
0
11
1616

数据库的密码是根据填入的字符串 生成的32位MD5码。
现在要读取出来密码 并修改密码。

问题就是:怎么讲32位的MD5码还原成原来的String字符串。。

有会的吗 谢谢、、、

PHP中文网
PHP中文网

认证0级讲师

reply all(11)
刘奇

I think the poster may be a beginner, and the final problem he wants to solve is how to change the password. This question is just a problem that arises when changing the password. Since the idea of ​​changing the password is wrong, the question deviates from the direction.

However, when I saw the long replies from the people above, I just caught on to a knowledge point that beginners don’t understand. The result may be that the poster doesn’t even understand what you are talking about. No solution or possible solution to the problem is given at all.

The solution to this problem is:

  1. You first set up 3 input boxes

  2. Then the first one is to let the user enter the original password.

  3. The second and third input boxes are used to allow users to enter new passwords and confirm new passwords.

After submission, compare the user’s original password using the previous encryption method such as your md5 encryption with the encrypted password stored in the database. If they are the same, it means that the original password is correct. It can be determined that the user's identity is legitimate. (As for why this is the case, because md5 is irreversible, so we will just encrypt it again. Compare it with you. The same password should be encrypted the same.)

If the user's identity is legitimate, you should know that the new password is encrypted and saved. N lines of verification code are omitted here.

阿神

Okay MD5根本就不是加密算法好不好。。。。MD5摘要算法。。。 摘要算法理论上讲是不需要逆向解码.

巴扎黑

First of all, it is recommended that the subject should search first if he encounters a problem.
Secondly, MD5 is an irreversible encryption algorithm. If the project needs to change the password, the password entered by the user will be md5 encrypted and then the key will be matched. If you just want to restore MD5, there are many online decryption methods on the Internet, but they can only decrypt relatively simple passwords.


Finally, I suggest the question author close this question, it is really meaningless , thank you

迷茫

Oh my God~
I scared the baby to death~
You actually want to解密~


  • User that gets旧密码新密码.

  • Encrypt 旧密码 md5.

  • Compare the encrypted 旧密码 with the database password.

  • If the same, then encrypt 新密码md5 and store it in the database.


The digest algorithm is not so easy to reverse.
Of course you can use the online md5 decryption tool.


黄舟

In principle, it is not possible, md5 is one-way encryption. During verification, the md5 values ​​are also compared to see if they are the same. If you want to crack it, you can download the data from the ready-made rainbow table, but the result is not guaranteed to be 100%. It will take a long time to hit md5 on the spot.

刘奇

This is basically impossible. Decryption on the Internet depends on chance. If you are lucky, you may encounter the same md5 value and corresponding string. Moreover, md5 values ​​do not correspond to strings one-to-one. The md5 values ​​of many strings are the same...

大家讲道理

It is impossible to restore, but it is possible to try to collide

Peter_Zhu

The questioner can search on Baidu to find out what MD5,它是一种不可逆的算法。可逆的比如Base64 and other algorithms are.

刘奇

md5 cannot be restored. Otherwise, there is no need to brute force it, just restore it directly.
It is recommended to search for the salted PBKDF2 algorithm.

大家讲道理

MD5 is designed so that it cannot be restored. Every time you verify, you need to convert the password to 32 bits, and then compare it with the 32 bits stored in the database;

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template