将单词更改为md5加密形式的代码

编程入门 行业动态 更新时间:2024-10-27 08:29:39
本文介绍了将单词更改为md5加密形式的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将密码更改为md5加密形式,然后保存到数据库中,请提供代码.

i want to change my password to md5 encrypted form and then save to the database please provide the code.

推荐答案

这不是加密,而是加密哈希函数 ,这是非常不同的东西.是的,它足以存储密码.请参见 en.wikipedia/wiki/Cryptographic_hash_function [ ^ ]. 一个字或一个警告:请勿使用MD5!该算法被认为已损坏,请参见 en.wikipedia/wiki/MD5 [ ^ ].我建议使用安全哈希算法("SHA")系列的功能,请参见 en.wikipedia/Wiki/SHA2 [ ^ ]. 要将密码哈希函数与PHP一起使用,请参见: php/manual/en/function.hash.php [ ^ ].
—SA
This is not encryption, but a cryptographic hash function, which is a very different thing. Yes, it can be good enough to store passwords. See en.wikipedia/wiki/Cryptographic_hash_function[^]. A word or warning: don''t use MD5! This algorithm is considered broken, see en.wikipedia/wiki/MD5[^]. I would recommend to use the functions of the Secure Hash Algorithm ("SHA") family, see en.wikipedia/wiki/SHA2[^]. To use the cryptographic hash functions with PHP, see: php/manual/en/function.hash.php[^].
—SA

更多推荐

将单词更改为md5加密形式的代码

本文发布于:2023-10-24 23:57:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1525358.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单词   形式   代码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!