Server Error in '/' Application.

Key not valid for use in specified state.

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: Key not valid for use in specified state.


Source Error:


Line 34:     {
Line 35:         var bytes = Convert.FromBase64String(val);
Line 36:         var encBytes = System.Security.Cryptography.ProtectedData.Unprotect(bytes, new byte[0], System.Security.Cryptography.DataProtectionScope.LocalMachine);
Line 37:         return System.Text.Encoding.UTF8.GetString(encBytes);
Line 38:     }

Source File: e:\hostingspaces\afb2f89c\pssilksarees.com\wwwroot\App_Code\secureurl.cs    Line: 36

Stack Trace:


[CryptographicException: Key not valid for use in specified state.
]
   System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope) +669
   secureurl.Decrypt(String val) in e:\hostingspaces\afb2f89c\pssilksarees.com\wwwroot\App_Code\secureurl.cs:36
   sliderange.Page_Load(Object sender, EventArgs e) in e:\hostingspaces\afb2f89c\pssilksarees.com\wwwroot\sliderange.aspx.cs:174
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062