Padding is invalid and cannot be removed

5 posts, 0 answers
  1. Marco du Plessis
    Marco du Plessis avatar
    3 posts
    Member since:
    Apr 2009

    Posted 14 May 2010 Link to this post

    Hi ,

    My asp.net page contains a radscheduler , whenever I view this page I get the following error.

    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, 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)

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2809 posts

    Posted 18 May 2010 Link to this post

    Hi Marco,

    This is a common problem with the WebResource.axd ASP.NET handler in web farms. You need to set the machine key to be the same on all servers. More information, as well as further troubleshooting advice can be found in this series of blog posts:

    http://blogs.telerik.com/AtanasKorchev/Posts/08-07-18/Web_Resources_demystified_Part_3_Troubleshooting.aspx

    I hope this helps.

    All the best,
    Tsvetomir Tsonev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Marco du Plessis
    Marco du Plessis avatar
    3 posts
    Member since:
    Apr 2009

    Posted 28 Jun 2010 Link to this post

    Hi ,

    I am still experiencing this problem, we dont have a server farm environment setup at our hosting company, is there no other possible solution.
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2809 posts

    Posted 28 Jun 2010 Link to this post

    Hello Marco,

    The machine key will also change when the application pool is restarted so the problem is not only with web farms. Setting it to a fixed value should solve the problem.

    Greetings,
    Tsvetomir Tsonev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 18 Jul 2011 Link to this post

    Hi Tsvetomir,

    We have been experiencing this problem with the 2011.1.519.40 version of the Telerik Ajax controls.  There were also a lot of fragmented responses that broke the ajax as parts of the page were missing.  Rolling back to 2010.3.1215.40 stopped the errors again.  I am going to try the latest version and see if the problem is fixed.  This was never a problem for us until 2011.1.519.40.

    Craig
Back to Top