Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

System.Security.Cryptography.CryptographicException

Vote:
 
Hello In the past few days our ASP.NET webapp has thrown cryptographic exceptions(see logentry at the end of the post). Since I'm pretty novice on Cryptography, I wonder if anyone have any idea what causes this, and can give me a quick explanation? logentry: 2007-11-01 22:30:04,515 [3904] ERROR EPiServer.Global [] - 1.2.4 FormsAuthentication failed Exception: System.Security.Cryptography.CryptographicException Message: Bad Data. Source: mscorlib at System.Security.Cryptography.CryptoAPITransform._DecryptData(IntPtr hKey, Byte[] rgb, Int32 ib, Int32 cb, Boolean fDone) at System.Security.Cryptography.CryptoAPITransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Web.Configuration.MachineKey.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length) at System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket) at EPiServer.Global.FormsAuthentication_OnAuthenticate(Object sender, FormsAuthenticationEventArgs e)
#17735
Nov 02, 2007 8:39
Vote:
 
Problem solved. As a reference for others, this is because of load balancing and viewstate encryption. You need to make sure all servers in a web farm has the same machinekey in web.config. /Steve
#18555
Nov 15, 2007 21:02
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.