c# aes cryptostream specified padding mode is not valid for this algorithm的解決方法 -ag凯发k8国际
//解密數據
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
总结
以上是ag凯发k8国际为你收集整理的c# aes cryptostream specified padding mode is not valid for this algorithm的解決方法的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: opencv探索之路(三):滤波操作
- 下一篇: 螺丝目视选别安全职责是什么?