3

命名空间System.Security.Cryptography中只有System.Security.Cryptography.X509Certificates 但我想使用 System.Security.Cryptography.MD5 我使用 Visual Studio 2012 我想开发一个 Windows Phone 8 应用程序 你能告诉我吗为什么???



4

3 回答 3

1

您可以在Cimbalino Windows Phone Toolkit中找到 MD5 实现。

只需将其添加到您的项目中(使用NuGet),将以下内容添加到代码文件的顶部:

using Cimbalino.Phone.Toolkit.Extensions;

然后像这样在你的代码中使用它:

var myString = "this is my string data";

var myStringBytes = myString.GetBytes(); // this will get the UTF8 bytes for the string

var md5Hash = myStringBytes.ComputeMD5Hash().ToBase64String();
于 2013-03-14T10:12:58.363 回答
0

这是因为 MD5 是“不安全的”(参见wikipedia .

您可以使用M5 类(我将它用于我的 wp8 项目)。

问候

于 2013-03-14T09:49:14.920 回答
0

Windows phone 不支持 MD5 加密,这里是一个在 c# 中实现 md5 的好例子

于 2013-03-14T10:25:45.790 回答