title: Decryption Error : Length of the data to decrypt is invalid
body: <p>I used this code to decrypt my file, but I have receive this error:</p>
  
  <blockquote>
    <p>Decryption Error : Length of the data to decrypt is invalid </p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>private void DecryptFile(string inputFile, string outputFile)
  {
      //try
      //{
      string password = @"myKey123"; // Your Key Here
  
      UnicodeEncoding UE = new UnicodeEncoding();
      byte[] key = UE.GetBytes(password);
  
      FileStream fsCrypt = new FileStream(inputFile, FileMode.Open);
  
      RijndaelManaged RMCrypto = new RijndaelManaged();
  
      CryptoStream cs = new CryptoStream(fsCrypt,
          RMCrypto.CreateDecryptor(key, key),
          CryptoStreamMode.Read);
  
      FileStream fsOut = new FileStream(outputFile, FileMode.Create);
  
      int data;
      while ((data = cs.ReadByte()) != -1)
          fsOut.WriteByte((byte)data);
  
      fsOut.Close();
      cs.Close();
      fsCrypt.Close();
  
      //}
      //catch
      //{
      //    Label12.Text = "Decryption failed!";
      //}
  }
  </code></pre>
  
  <p>It works good in c# application but I have error in asp.net pages!</p>