zoukankan      html  css  js  c++  java
  • 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);
                            }
                        }
                    }
                }

  • 相关阅读:
    sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock
    redis常用命令大全
    MySQL explain使用
    rabbitmq添加user及vhost
    Make sure you've included captcha.urls as explained in the INSTALLATION section on
    django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applie
    ARM实验5 —— 按键中断实验
    ARM实验4—按键轮询实验
    ARM实验3 ——串口实验
    ARM实验2 —— 蜂鸣器实验
  • 原文地址:https://www.cnblogs.com/kzwrcom/p/6879853.html
Copyright © 2011-2022 走看看