C# Aes CryptoStream Specified padding mode is not valid for this algorithm的解決方法
?//解密數據
??????????? using (var ss = File.OpenRead(@"d:\qq.d.flac"))
??????????? {
??????????????? using (FileStream w = new FileStream(@"d:\qq.flac", FileMode.Create))
??????????????? {
??????????????????? using (var cs = AesStream.StreamDecrypt(w, "qq"))
??????????????????? {
??????????????????????? ss.Seek(0, SeekOrigin.Begin);
??????????????????????? for (int i = 0; i < ss.Length; i += 4096)
??????????????????????? {
??????????????????????????? byte[] chunkData = new byte[4096];
??????????????????????????? int bytesRead = 0;
??????? //Updates the underlying data source or repository with the current state of the buffer, then clears the buffer.
??????????????????????????? if (!cs.HasFlushedFinalBlock)
??????????????????????????? {
??????????????????????????????? cs.FlushFinalBlock();
??????????????????????????? }
??????????????????????????? bytesRead = ss.Read(chunkData, 0, chunkData.Length);
??????????????????????????? if (i > 4096*1024)
??????????????????????????? {
??????????????????????????????? break;
??????????????????????????? }
??????????????????????????? cs.Write(chunkData, 0, bytesRead);
??????????????????????? }
??????????????????? }
??????????????? }
??????????? }
轉載于:https://www.cnblogs.com/kzwrcom/p/6879853.html
總結
以上是生活随笔為你收集整理的C# Aes CryptoStream Specified padding mode is not valid for this algorithm的解決方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OpenCV探索之路(三):滤波操作
- 下一篇: 螺丝目视选别安全职责是什么?