title: AES decryption The input data is not a complete block
body: <p>I'm trying to encrypt a <code>string</code> and decript it using <code>AES</code>. The encryption worked fine but I'm getting an error of <code>The input data is not a complete block</code> for the decryption. Is there an issue with my padding?</p>
  
  <pre><code>var aes = System.Security.Cryptography.Aes.Create();
  aes.GenerateKey();
  aes.GenerateIV();
  aes.Mode = CipherMode.CBC;
  aes.Padding = PaddingMode.PKCS7;
  
  var desEncrypter = aes.CreateEncryptor();
  var buffer = System.Text.ASCIIEncoding.ASCII.GetBytes(text);
  
  finalV = Convert.ToBase64String(desEncrypter.TransformFinalBlock(buffer, 0, buffer.Length));
  
  var desDecrypter = aes.CreateDecryptor();
  var buff = System.Text.Encoding.ASCII.GetBytes(finalV);
  
  var origValue = desDecrypter.TransformFinalBlock(buff , 0, buff .Length);
  </code></pre>