Windows Phone 7中的AES加密 [英] AES Encryption in Windows Phone 7

查看:78
本文介绍了Windows Phone 7中的AES加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现我在James Craig的 gutgames 中找到的实用程序类,(您可以查看Windows Phone 7使用此处)。

I'm trying to implement this utility class I found on gutgames by James Craig, (you can view the class here) with Windows Phone 7.

我必须将对System.Text.Encoding.ASCII的所有引用替换为System.Text.Encoding.UTF8,因为WP7中显然不支持ASCII。除此之外,由于找不到引用/名称空间,我仍然遇到一些错误:

I had to replace all the references to System.Text.Encoding.ASCII to System.Text.Encoding.UTF8 since ASCII apparently is not supported in WP7. Besides that I'm still getting some errors because of references / namespaces not being found:


  • PasswordDeriveBytes

  • RijndaelManaged

  • CipherMode

首先我不知道这是什么,其次,是否有任何类可以用来替换这些类,而这些类确实可以在Windows Phone 7框架中使用?

Firstly I don't have a clue what this is, secondly, are there any classes that I can use to replace these that indeed will be available in the Windows Phone 7 framework?

谢谢!

推荐答案

PasswordDeriveBytes RijndaelManaged CipherMode 类型未实现在Silverlight中。因此,您需要提供自己的这些类型的实现。

The PasswordDeriveBytes, RijndaelManaged and CipherMode types are not implemented in Silverlight. So you need to provide your own implementation of these types.

但是我想使用可以使用 AesManaged 类可以执行您想要的操作。在MSDN页面上:

BUT I guess that use can use AesManaged class to do what you want. From MSDN page:


AES算法本质上是Rijndael对称算法,其中
具有固定的块大小和迭代计数。该类的功能与.NET Framework RijndaelManaged类的
相同,但是将块限制为
128位,并且不允许使用反馈模式。

The AES algorithm is essentially the Rijndael symmetric algorithm with a fixed block size and iteration count. This class functions the same way as the .NET Framework RijndaelManaged class but limits blocks to 128 bits and does not allow feedback modes.

密码模式始终为CBC,填充模式始终为PKCS7。

The cipher mode is always CBC, and the padding mode is always PKCS7.

这篇关于Windows Phone 7中的AES加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆