title: padding is invalid and cannot be removed c# decrypt
body: <p>I saw that exists another questions about this topic, but I checked every question and I can't solve my problem..
  This is my method to decrypt and another method to call decrypt method with required parameters:</p>
  
  <pre><code>public string Decrypt(AesOperationType operationType, byte[] criptotext, byte[] Key, byte[] initVector)
  {
  
          string plaintext = null;
  
          using (Aes aesAlg = Aes.Create())
          {
              aesAlg.KeySize = 128;
              aesAlg.Key = Key;
              aesAlg.IV = initVector;
              if (operationType == AesOperationType.Cbc)
              {
                  aesAlg.Mode = CipherMode.CBC;
              }
              else if (operationType == AesOperationType.Cfb)
              {
                  aesAlg.Mode = CipherMode.ECB;
              }
  
              //apelam functia de decriptare 
              ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
  
              using (MemoryStream msDecrypt = new MemoryStream(criptotext))
  
              using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
              {
                  using (StreamReader srDecrypt = new StreamReader(csDecrypt))
                  {
                      plaintext = srDecrypt.ReadToEnd();
                  }
              }
          }
          Console.WriteLine("Start decrypt for criptotext : " + BitConverter.ToString(criptotext) + "\n");
          Console.WriteLine("Plaintext after decrypt : " + plaintext + "\n");
  
          return plaintext;
  }
  
  public byte[] Encrypt_Call()
  {
          var key = "1212121212121212";
          var key_byte = Encoding.ASCII.GetBytes(key);
          using (Aes aess = Aes.Create())
          {
              var iv = aess.IV;
              cryptdecrypt object = new cryptdecrypt();
              var result = object.Encrypt(AesOperationType.Cbc, "plaintext", key_byte, iv);
              return result;
          }
  }
  
  public void Decrypt_Call()
  {
          var key = "1212121212121212";
          var key_byte = Encoding.ASCII.GetBytes(key);
          using (Aes aess = Aes.Create())
          {
              var iv = aess.IV;
              cryptdecrypt object = new cryptdecrypt();
              var cryptotext = Encrypt_Call();
              var result = object.Decrypt(AesOperationType.Cbc, cryptotext , key_byte, iv);
          }
  }
  </code></pre>
  
  <p>Encrypt method works fine, but at decryption method call, I face this error:</p>
  
  <blockquote>
    <p>Padding is invalid and cannot be removed. </p>
  </blockquote>
  
  <p>I also tried to put <code>csDecrypt.FlushFinalBlock()</code> this line before this line:</p>
  
  <pre><code>using (StreamReader srDecrypt = new StreamReader(csDecrypt))
  </code></pre>
  
  <p>The error disappears and as result I get an empty string.</p>
  
  <p>Any ideas to solve this?</p>