您的位置:首页 > 其它

HashPasswordForStoringInConfigFile中的Md5算法并非常用的Md5算法

2007-08-20 09:24 585 查看
本来我也以为System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile中的MD5和常用的一样

一看MSDN的解释,原来是

Given a password and a string identifying the hash type, this routine produces a hash password suitable for storing in a configuration file.

大家不要用HashPasswordForStoringInConfigFile取得的加密保存在数据库中,这个只适合保存在配置文件中,

在需要验证的时候,会自动根据加密方式验证。

<body onload=document.all.txtClear.select();>

<form runat="server">

明文:<asp:Textbox id="txtClear" runat="server" />

<asp:Button runat="server" text="Md5摘要" onClick="encryptString" ID="Button1" />

<br/>通常用的 MD5:

<br/><asp:label id="myMD5" runat="server" /> <br/>

<br/>HashPasswordForStoringInConfigFile中的 MD5:

<br/><asp:label id="MD5" runat="server" />

</form>

环境:vs.net2005/sql server2000/xp测试通过

1.MD5 16位加密实例

using System;

using System.Collections.Generic;

using System.Text;

using System.Security.Cryptography;

namespace md5
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐