Server Error in '/' Application.

Index was outside the bounds of the array.

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.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:


Line 89:             // Write the data and make it do the decryption 
Line 90:             cryptoStream.Write(cipherData, 0, cipherData.Length);
Line 91:             cryptoStream.Close();
Line 92: 
Line 93:             // Convert the decrypted stream to a byte array 

Source File: e:\hostingspaces\nitsjk\viewkashmir.com\wwwroot\App_Code\Encryption.cs    Line: 91

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) +7818131
   System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +7805956
   System.Security.Cryptography.CryptoStream.FlushFinalBlock() +33
   System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) +124
   System.IO.Stream.Close() +17
   Nits.ENC.Encryption.Decrypt(Byte[] cipherData, Byte[] key, Byte[] initialisationVector) in e:\hostingspaces\nitsjk\viewkashmir.com\wwwroot\App_Code\Encryption.cs:91
   Nits.ENC.Encryption.Decrypt(String encryptedText, String password) in e:\hostingspaces\nitsjk\viewkashmir.com\wwwroot\App_Code\Encryption.cs:39
   CMS_PageDescDisplay.Page_Load(Object sender, EventArgs e) in e:\hostingspaces\nitsjk\viewkashmir.com\wwwroot\CMS\PageDescDisplay.ascx.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8975