将单词更改为md5加密形式的代码 [英] Code to change the word to md5 encrypted form

查看:115
本文介绍了将单词更改为md5加密形式的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

推荐答案

这不是加密,而是加密哈希函数 ,这是非常不同的东西.是的,它足以存储密码.请参见 http://en.wikipedia.org/wiki/Cryptographic_hash_function [ http://en.wikipedia.org/wiki/MD5 [ ^ ].我建议使用安全哈希算法("SHA")系列的功能,请参见 http://en.wikipedia.org/Wiki/SHA2 [ ^ ].

要将密码哈希函数与PHP一起使用,请参见:
http://php.net/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 http://en.wikipedia.org/wiki/Cryptographic_hash_function[^].

A word or warning: don''t use MD5! This algorithm is considered broken, see http://en.wikipedia.org/wiki/MD5[^]. I would recommend to use the functions of the Secure Hash Algorithm ("SHA") family, see http://en.wikipedia.org/wiki/SHA2[^].

To use the cryptographic hash functions with PHP, see:
http://php.net/manual/en/function.hash.php[^].

—SA


这篇关于将单词更改为md5加密形式的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆