title: AES throwing Exception when decrypting
body: <p>I am using AES encryption, I have no issues encrypting and writing to DB when I decrypt, it returns null. </p>
  
  <p>The Key and IV are the same while encryption and also checked the padding, they are the same while performing encryption and decryption. </p>
  
  <pre><code>public byte[] Encrypt(string plainText, byte[] Key, byte[] IV)
  {
      byte[] password;
      // Create a new AesManaged.    
      using (AesManaged aes = new AesManaged())
      {
          // Create encryptor    
          ICryptoTransform encryptor = aes.CreateEncryptor(Key, IV);
          // Create MemoryStream    
          using (MemoryStream ms = new MemoryStream())
          {
              // Create crypto stream using the CryptoStream class. This class is the key to encryption    
              // and encrypts and decrypts data from any given stream. In this case, we will pass a memory stream    
              // to encrypt    
              using (CryptoStream cs = new CryptoStream(ms, encryptor, CryptoStreamMode.Write))
              {
                  // Create StreamWriter and write data to a stream    
                  using (StreamWriter sw = new StreamWriter(cs))
                      sw.Write(plainText);
                  password = ms.ToArray();
              }
          }
      }
  }
  
  public static string Decrypt(byte[] cipherText, byte[] Key, byte[] IV)
  {
      string plaintext = null;
      // Create AesManaged    
      using (AesManaged aes = new AesManaged())
      {
          // Create a decryptor    
          ICryptoTransform decryptor = aes.CreateDecryptor(Key, IV);
          // Create the streams used for decryption.    
          using (MemoryStream ms = new MemoryStream(cipherText))
          {
              // Create crypto stream    
              using (CryptoStream cs = new CryptoStream(ms, decryptor, CryptoStreamMode.Read))
              {
                  // Read crypto stream    
                  using (StreamReader reader = new StreamReader(cs))
                  plaintext = reader.ReadToEnd(); // Error is here , Throws exception "Padding is invalid and cannot be removed."
              }
          }
      }
      return plaintext;
  }
  
  Result : Decryption is achieved as expected
  </code></pre>