DESede/3DES ECB加密/解密在Windows Phone 8与c#



我正在寻找一种方法来加密密码字符串"DESede/ECB/PKCS5Padding"上的windows phone 8

不像Win8 RT,没有SymmetricKeyAlgorithmProvider

我试图添加一个bounceccastle c#库,如这里所建议的,但似乎没有密码"DESede/ECB/",但只有"DESede/CBC/"与IV密钥,而我想要ECB没有IV密钥

任何建议都将不胜感激。谢谢:)

EDIT:使用bounceccastle库解决方案:

// DESEDE, not DESEDE/CBC!!!
var cipher = CipherUtilities.GetCipher("DESEDE");
byte[] byte_key = Encoding.UTF8.GetBytes(string_key);
var param_key = new DesEdeParameters(byte_key);
byte[] data = Encoding.UTF8.GetBytes(string_data);
cipher.Init(true, param_key);
var data_encrypted = cipher.DoFinal(data);

这是使用pkcs# 5填充的3DES加密-解密-加密密码,它应该由BouncyCastle支持(搜索3DES ECB)。SecureBlackbox库也支持它(然而,它是商业的)。

最新更新