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 に答える