Use TripleDESCryptoServiceProvider class in Silverlight Application

≡放荡痞女 提交于 2019-12-22 00:24:14

问题


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.

How can I use this dll file for Silverlight application?


回答1:


There is no such thing as a System.Security.Cryptography 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.

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.



来源:https://stackoverflow.com/questions/11467327/use-tripledescryptoserviceprovider-class-in-silverlight-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!