Server Error in '/' Application.

Length of the data to decrypt is invalid.

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: Length of the data to decrypt is invalid.

Source Error:


Line 33:         public byte[] Decrypt(byte[] encryptedData, RijndaelManaged rijndaelManaged)
Line 34:         {
Line 35:             return rijndaelManaged.CreateDecryptor().TransformFinalBlock(encryptedData, 0, encryptedData.Length);
Line 36:         }
Line 37: 

Source File: e:\inetpub\vhosts\mahacu.org\mahacucouncil.org\httpdocs\App_Code\AES256.cs    Line: 35

Stack Trace:


[CryptographicException: Length of the data to decrypt is invalid.]
   System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +4787816
   WebApplication2.AES256.Decrypt(Byte[] encryptedData, RijndaelManaged rijndaelManaged) in e:\inetpub\vhosts\mahacu.org\mahacucouncil.org\httpdocs\App_Code\AES256.cs:35
   WebApplication2.AES256.Decrypt(String encryptedText, String key) in e:\inetpub\vhosts\mahacu.org\mahacucouncil.org\httpdocs\App_Code\AES256.cs:51
   MessageforRegistrer.Page_Load(Object sender, EventArgs e) in e:\inetpub\vhosts\mahacu.org\mahacucouncil.org\httpdocs\MessageforRegister.aspx.cs:36
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   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.4700.0