DotNet中密码的加密(转)

来源:互联网 发布:知乎精华话题 编辑:程序博客网 时间:2024/06/03 10:57
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<%@ Import Namespace="System.Web.Security" %>
<html>
<head>
<script language="VB" runat=server>
' This function encrypts the input string using the SHA1 and MD5
' encryption algorithms
Sub encryptString(Src As Object, E As EventArgs)
   SHA1.Text = CookieAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "SHA1")
   MD5.Text = CookieAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "MD5")
End Sub
</script>
</head>
<body>

<form runat=server>

<p><b>Original Clear Text Password: </b><br>
  <asp:Textbox id="txtPassword" runat=server />
  <asp:Button runat="server" text="Encrypt String" onClick="encryptString" /></p>

<p><b>Encrypted Password In SHA1: </b>
  <asp:label id="SHA1" runat=server /></p>

<p><b>Encrypted Password In MD5: </b>
  <asp:label id="MD5" runat=server /></p>

</form>

</body>
<

DotNet中密码加密(转)';return true">
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击