Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/158.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# AES填充并将密文写入磁盘文件 我有一个字符串,用C++加密,用C++加密: std::ifstream t(文件名)//要加密的文件 std::stringstream缓冲区; 缓冲区_C#_C++_Encryption_Padding_Crypto++ - Fatal编程技术网

C# AES填充并将密文写入磁盘文件 我有一个字符串,用C++加密,用C++加密: std::ifstream t(文件名)//要加密的文件 std::stringstream缓冲区; 缓冲区

C# AES填充并将密文写入磁盘文件 我有一个字符串,用C++加密,用C++加密: std::ifstream t(文件名)//要加密的文件 std::stringstream缓冲区; 缓冲区,c#,c++,encryption,padding,crypto++,C#,C++,Encryption,Padding,Crypto++,根据注释: 在C++中,我保存了一个文件,结合了.2文件,如何将C++中的密文传送到C++的边上?在C++中,我保存了一个文件 CudioD.Fiel2,通常如果链中某个地方,你可以得到这种例外,密文被转换成字符串而不是二进制。我用这个例子来加密:我也不加1的测试它。但问题依然存在。密文是字节[238533]。您能告诉我们如何保护字符串吗?直接加密后的字符串大小是多少?请注意,不应使用null终止符来确定大小,字符串应视为字节。 StringSource ss(ciphertext, true

根据注释:


在C++中,我保存了一个文件,结合了.2文件,如何将C++中的密文传送到C++的边上?在C++中,我保存了一个文件<代码> CudioD.Fiel2,通常如果链中某个地方,你可以得到这种例外,密文被转换成字符串而不是二进制。我用这个例子来加密:我也不加1的测试它。但问题依然存在。密文是字节[238533]。您能告诉我们如何保护字符串吗?直接加密后的字符串大小是多少?请注意,不应使用null终止符来确定大小,字符串应视为字节。
StringSource ss(ciphertext, true /*pumpAll*/);
FileSink fs("my-encrypted-file.bin", true /*binary*/);
ss.TransferTo(fs);
ofstream combined_file2;
...
combined_file2.write(ciphertext.data(), ciphertext.size());