search

Home  >  Q&A  >  body text

java - 32位的MD5的加密码 怎么还原成原来的String字符串

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

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

有会的吗 谢谢、、、

PHP中文网PHP中文网2802 days ago1598

reply all(11)I'll reply

  • 怪我咯

    怪我咯2017-04-18 09:42:41

    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.

    reply
    0
  • 阿神

    阿神2017-04-18 09:42:41

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

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-18 09:42:41

    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

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:42:41

    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.


    reply
    0
  • 黄舟

    黄舟2017-04-18 09:42:41

    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.

    reply
    0
  • 怪我咯

    怪我咯2017-04-18 09:42:41

    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...

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 09:42:41

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

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-18 09:42:41

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

    reply
    0
  • 怪我咯

    怪我咯2017-04-18 09:42:41

    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.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 09:42:41

    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;

    reply
    0
  • Cancelreply