Exception with Ent Lib Cryptography (symmetricCryptoProvider) block when used in Web Farm

Topics: Cryptography Application Block, Enterprise Library Core, General discussion
Dec 27, 2007 at 4:39 AM
We have a application that is using Ent Lib Cryptography to encry and decrypt the querystring data.
The applicaiton worked fine on the stand alone machine. However when we move it to a web farm we are intermittently getting the following Exception "Padding is invalid and cannot be removed".

Has anyone faced this issue earlier? What is the cause / resolution for this? How can we mitigate this intermittent exception?

Please suggest.

Stack Trace is :

at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.CryptographyUtility.Transform(ICryptoTransform transform, Byte[] buffer) at Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricCryptographer.Decrypt(Byte[] encryptedText) at Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricAlgorithmProvider.Decrypt(Byte[] ciphertext) at Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.DecryptSymmetric(String symmetricInstance, Byte[] ciphertext) at Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.DecryptSymmetric(String symmetricInstance, String ciphertextBase64) at CommonFramework.Utilities.Encryption.DecryptString(String inputstring)
Dec 27, 2007 at 11:33 AM
Hi,

Please refer to this thread http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=14897.

Regards,
Fernando