📄 subject_52814.htm
字号:
<p>
序号:52814 发表者:叮当 发表日期:2003-09-14 22:43:59
<br>主题:问题:(030914.3)
<br>内容:我想把数据库中的用户密码字符串进行加密。我记得在asp中有这样的加密函数,不知道在asp.net里是什么函数??<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:仙达流 回复日期:2003-09-15 09:21:04
<br>内容:.NET 框架提供以下实现私钥加密算法的类: <BR><BR>DESCryptoServiceProvider <BR>RC2CryptoServiceProvider <BR>RijndaelManaged <BR>TripleDESCryptoServiceProvider <BR>ms-help://MS.VSCC/MS.MSDNVS.2052/cpguide/html/cpconcryptographyoverview.htm
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:叮当 回复日期:2003-09-18 19:28:12
<br>内容:找到了:<BR>M_D5 类 [C#]请参见<BR>M_D5 成员 | System.Security.Cryptography 命名空间 <BR>要求<BR>命名空间: System.Security.Cryptography<BR><BR>平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family<BR><BR>程序集: Mscorlib (在 Mscorlib.dll 中)<BR>语言<BR>C#<BR><BR>C++<BR><BR>JScript<BR><BR>Visual Basic<BR><BR>全部显示<BR><BR><BR>表示 M_D5 哈希算法的所有实现均从中继承的抽象类。<BR><BR>有关此类型所有成员的列表,请参阅 M_D5 成员。<BR><BR>System.Object<BR> System.Security.Cryptography.HashAlgorithm<BR> System.Security.Cryptography.M_D5<BR> System.Security.Cryptography.M_D5CryptoServiceProvider<BR><BR>[Visual Basic]<BR>MustInherit Public Class M_D5<BR> Inherits HashAlgorithm<BR>[C#]<BR>public abstract class M _D5 : HashAlgorithm<BR>[C++]<BR>public __gc __abstract class M_D5 : public HashAlgorithm<BR>[JScript]<BR>public abstract class M_D5 extends HashAlgorithm<BR>线程安全<BR>此类型的所有公共静态(Visual Basic 中为 Shared)成员对多线程操作而言都是安全的。但不保证任何实例成员是线程安全的。<BR><BR>备注<BR>哈希函数将任意长度的二进制字符串映射为固定长度的小型二进制字符串。加密哈希函数有这样一个属性:在计算上不大可能找到散列为相同的值的两个不同的输入;也就是说,两组数据的哈希值仅在对应的数据也匹配时才会匹配。数据的少量更改会在哈希值中产生不可预知的大量更改。<BR><BR>示例<BR>[Visual Basic, C#] 下面的示例计算 data 的 M_D5 哈希值,并将其存储在 result 中。此示例假定有预定义的常数 DATA_SIZE。<BR><BR>[Visual Basic] <BR>Dim data(DATA_SIZE) As Byte<BR><BR>' This is one implementation of the abstract class M _D5.<BR>Dim m _d5 As New M _D5CryptoServiceProvider()<BR><BR>Dim result As Byte() = m_ d5.ComputeHash(data)<BR>[C#] <BR>byte[] data = new byte[DATA_SIZE];<BR><BR>// This is one implementation of the abstract class M _D5.<BR>M_ D5 m_ d5 = new M_ D5CryptoServiceProvider();<BR><BR>byte[] result = m _d5.ComputeHash(data);<BR>[C++, JScript] 没有可用于 C++ 或 JScript 的示例。若要查看 Visual Basic 或 C# 示例,请单击页左上角的语言筛选器按钮 。<BR><BR>要求<BR>命名空间: System.Security.Cryptography<BR><BR>平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family<BR><BR>程序集: Mscorlib (在 Mscorlib.dll 中)<BR><BR>不过还是要谢谢楼上的~
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -