Padding is invalid and cannot be removed.

Discussion in 'ASP .Net Security' started by Amelyan, Aug 12, 2007.

  1. Amelyan

    Amelyan Guest

    Why does this happen? How to fix it?

    Once in a while I get error in ~/ScriptResource.axd?d=...

    System.Reflection.TargetInvocationException: Exception has been thrown by
    the target of an invocation. --->
    System.Security.Cryptography.CryptographicException: Padding is invalid and
    cannot be removed.

    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.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean
    fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean
    useValidationSymAlgo)

    at System.Web.UI.Page.DecryptString(String s)

    --- End of inner exception stack trace ---

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[]
    arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
    RuntimeTypeHandle typeOwner)

    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[]
    arguments, Signature sig, MethodAttributes methodAttributes,
    RuntimeTypeHandle typeOwner)

    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
    skipVisibilityChecks)

    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

    at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)

    at System.Web.Handlers.ScriptResourceHandler.DecryptString(String s)

    at
    System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection
    queryString)

    at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext
    context)

    at
    System.Web.Handlers.ScriptResourceHandler.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)
    Amelyan, Aug 12, 2007
    #1
    1. Advertising

  2. I get this error once in a while in once of my web applications, and after
    doing some searching on Google, it sounds like the error is caused by Google
    trying to get information from sites to rank them.

    Not sure if it is true, but it was the only information I found...


    "Amelyan" <> wrote in message
    news:%...
    > Why does this happen? How to fix it?
    >
    > Once in a while I get error in ~/ScriptResource.axd?d=...
    >
    > System.Reflection.TargetInvocationException: Exception has been thrown by
    > the target of an invocation. --->
    > System.Security.Cryptography.CryptographicException: Padding is invalid
    > and
    > cannot be removed.
    >
    > 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.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean
    > fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean
    > useValidationSymAlgo)
    >
    > at System.Web.UI.Page.DecryptString(String s)
    >
    > --- End of inner exception stack trace ---
    >
    > at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[]
    > arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
    > RuntimeTypeHandle typeOwner)
    >
    > at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[]
    > arguments, Signature sig, MethodAttributes methodAttributes,
    > RuntimeTypeHandle typeOwner)
    >
    > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
    > Boolean
    > skipVisibilityChecks)
    >
    > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    >
    > at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
    >
    > at System.Web.Handlers.ScriptResourceHandler.DecryptString(String s)
    >
    > at
    > System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection
    > queryString)
    >
    > at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext
    > context)
    >
    > at
    > System.Web.Handlers.ScriptResourceHandler.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)
    >
    >
    >
    >
    >
    AutoTrackerPlus, Sep 8, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Smith
    Replies:
    0
    Views:
    4,931
    Robert Smith
    Dec 8, 2005
  2. Brent K
    Replies:
    2
    Views:
    639
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2007
  3. rdlauer
    Replies:
    1
    Views:
    368
    bruce barker
    Jul 16, 2007
  4. Amelyan
    Replies:
    0
    Views:
    573
    Amelyan
    Aug 12, 2007
  5. Amelyan
    Replies:
    2
    Views:
    452
    Amelyan
    Aug 13, 2007
Loading...

Share This Page