Server Error in '/' Application.

The input data is not a complete block.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: The input data is not a complete block.

Source Error:


Line 75:             Using cs As New CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write)
Line 76:                 cs.Write(cipherBytes, 0, cipherBytes.Length)
Line 77:                 cs.Close()
Line 78:             End Using
Line 79:             cipherText = Encoding.Unicode.GetString(ms.ToArray())

Source File: h:\root\home\fsolis-002\www\ITAEM\App_Code\Generador.vb    Line: 77

Stack Trace:


[CryptographicException: The input data is not a complete block.]
   System.Security.Cryptography.CapiSymmetricAlgorithm.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +4885554
   System.Security.Cryptography.CryptoStream.FlushFinalBlock() +34
   System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) +52
   System.IO.Stream.Close() +21
   Generador.Decrypt(String cipherText, String EncryptionKey) in h:\root\home\fsolis-002\www\ITAEM\App_Code\Generador.vb:77
   Default2.Page_Load(Object sender, EventArgs e) in h:\root\home\fsolis-002\www\ITAEM\Oferta.aspx.vb:20
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.9224.0