Silverlight C#中的MD5或其他加密。
|
我正在尝试对用于登录系统的密码字段进行加密,因此我想对加密进行匹配,以确保用户输入了正确的详细信息。
由于某些原因,Silverlight中Security.Cryptography没有MD5服务,因此我不得不寻找另一种方法。
我以前曾用过:
public string Md5Encrypt(string originalPassword)
{
//Declarations
Byte[] originalBytes;
Byte[] encodedBytes;
MD5 md5;
//Instantiate MD5CryptoServiceProvider, get bytes for original password and compute hash (encoded password)
md5 = new MD5CryptoServiceProvider();
originalBytes = ASCIIEncoding.Default.GetBytes(originalPassword);
encodedBytes = md5.ComputeHash(originalBytes);
//Convert encoded bytes back to a \'readable\' string
return BitConverter.ToString(encodedBytes);
}
但是现在不起作用。
谁能给我一个简单的示例,说明Silverlight C#中有效的加密方法
谢谢
没有找到相关结果
已邀请:
1 个回复
喷乡顾沥沪