在Silverlight应用程序中使用TripleDESCryptoServiceProvider类 [英] Use TripleDESCryptoServiceProvider class in Silverlight Application
问题描述
我使用Web服务进行身份验证.并且此Web服务使用TripleDes算法来加密用户名和密码.在我的Silverlight应用程序中,我必须加密这些值才能调用Web服务,但无法添加System.Security.Cryptography dll的引用.
I use a web service to authenticate. And this web service use the TripleDes algorithm to encrypt to user name and password. Im my silverlight application I have to encrypt these value for calling web service but I can not add reference of System.Security.Cryptography dll.
如何将这个dll文件用于Silverlight应用程序?
How can I use this dll file for Silverlight application?
推荐答案
没有System.Security.Cryptography
dll之类的东西.
There is no such thing as a System.Security.Cryptography
dll.
System.Security.Cryptography
是Microsoft随附的多个程序集中存在的名称空间.对于TripleDESCryptoServiceProvider
,该类型位于mscorlib.dll
内部.
System.Security.Cryptography
is a namespace present in several assemblies that Microsoft ships. In case of TripleDESCryptoServiceProvider
the type is present inside mscorlib.dll
.
不幸的是,Silverlight配置文件在其自己的(最小)mscorlib.dll
(或任何其他程序集)中均未附带TripleDESCryptoServiceProvider
.
Sadly Silverlight profile does not ship with TripleDESCryptoServiceProvider
inside it's own (minimal) mscorlib.dll
(or inside any other assembly).
However you can get a fully compatible (and 100% managed) version of 3DES from the Mono project (MIT X.11 licensed). You simply have to add the source file (and other files it depends on) to your own project, rebuild and use it like the normal desktop .NET framework.
这篇关于在Silverlight应用程序中使用TripleDESCryptoServiceProvider类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!