0

例外:来源:mscorlib 消息:填充无效且无法删除。

堆栈跟踪:

at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) 
at System.Security.Cryptography.CryptoStream.FlushFinalBlock() 
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) 
at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) 
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) 
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

我们的机器键也没有设置为自动。所以有人可以帮忙。谢谢

4

1 回答 1

0

加密消息的来源是什么?如果您确定密钥和IV 匹配,那么您必须在过程的两端查看分组密码模式(例如CBC、CTR、ECB)和填充模式是否也匹配。如果所有这些加起来,那么您可能会在加密和解密之间截断字节数组,这可能是由于一个错误的错误。

发布您的一些代码可能有助于我们进行诊断。

于 2012-02-06T15:35:53.063 回答