title: Padding is invalid and cannot be removed using RijndaelManaged
body: <p>when i trying to decrypt a string using PaddingMode.PKCS7 i'm getting 'Padding is invalid and cannot be removed' exception, but when i try using PaddingMode.Zeros i'm not getting any exception. </p>
  
  <p>P.S I've encrypted the script using PaddingMode.PKCS7 so i have to decrypt script using same PaddingMode. </p>
  
  <pre><code>if (encrypted == null || encrypted.Length == 0)
                  throw new ArgumentNullException("ecrypted");
              if (keyArr == null || keyArr.Length == 0)
                  throw new ArgumentNullException("keyArr");
              if (iv == null || iv.Length == 0)
                  throw new ArgumentNullException("iv");
  
              using (RijndaelManaged rij = new RijndaelManaged())
              {
  
                  rij.Padding = PaddingMode.PKCS7;
                  rij.Mode = CipherMode.CBC;
                  rij.KeySize = 128;
                  rij.BlockSize = 128;
  
                  rij.Key = keyArr;
                  rij.IV = iv;
  
                  ICryptoTransform decryptor = rij.CreateDecryptor();
  
                  using (MemoryStream ms = new MemoryStream())
                  {
                      using (CryptoStream cs = new CryptoStream(ms, decryptor, CryptoStreamMode.Write))
                      {
                          cs.Write(encrypted, 0, encrypted.Length);
                      }
                      plainText = Encoding.UTF8.GetString(ms.ToArray());
                  }
  
              }
  </code></pre>
  
  <p>Thanks in advance </p>