问题描述
- c++实现TripleDESCryptoServiceProvider解密方法
- 这是C#的例子:
DESCryptoServiceProvider provider = new DESCryptoServiceProvider(); byte[] buffer = new byte[pToDecrypt.Length / 2]; for (int i = 0; i < (pToDecrypt.Length / 2); i++) { int num2 = Convert.ToInt32(pToDecrypt.Substring(i * 2 2) 0x10); buffer[i] = (byte)num2; } provider.Key = Encoding.ASCII.GetBytes(keys); provider.IV = Encoding.ASCII.GetBytes(keys); MemoryStream stream = new MemoryStream(); CryptoStream stream2 = new CryptoStream(stream provider.CreateDecryptor() CryptoStreamMode.Write); stream2.Write(buffer 0 buffer.Length); stream2.FlushFinalBlock(); return Encoding.Default.GetString(stream.ToArray());
求方法,用C++替代上面的方法,主要是key和iv怎么处理?
解决方案
这块这个是不是:
windows的
时间: 2024-09-10 17:57:04