douping1825 2015-04-21 19:08
浏览 488
已采纳

如何解码密码:$ password = md5(addslashes($ _POST ['password']));

As the title, please kindly show me how to decode a password string encoded by this:

$password = md5( addslashes( $_POST['password'] ) );

For the example: f21601fea7f496cfbc23f7310e13f941

Thank you!

  • 写回答

1条回答 默认 最新

  • doufei2328 2015-04-21 19:12
    关注

    MD5 is a one-way hashing algorithm. The nature of such an algorithm is it cannot be reversed. It it could, it'd be an encryption algorithm, not hashing.

    Before you go switch to an encryption algorithm, don't. Passwords should always be stored as hashes if possible (there are unusual cases, like where you're storing a password for a third-party system). This protects your users if your code/database get compromised.

    For simple strings, it may be possible to lookup an MD5 hash in a "rainbow table". As an example, 098f6bcd4621d373cade4e832627b4f6 can be put into a tool like http://md5cracker.org/ to find out the password is probably test (but it could be another string that results in the same hash, known as a collision).

    Note: MD5 is also insecure because of the speed for which you can generate a rainbow table. You should use PHP's built in password_hash / password_verify functions when hashing passwords, as they take advantage of the secure bcrypt hashing algorithm.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀