Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Strange error-(WebResource.axd) CryptographicException: Padding is invalid and cannot be removed.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brent K - 12 Jul 2007 16:49 GMT
Ok, I have an internal intranet website created in visual studio 2005, c#.
It was running fine for months, and then all of the sudden a few days I
started getting these errors emailed to me (I have it set up to email me
exceptions). Here is the error. I have gotten this error probably 100 times
in the last 2 days.

I have googled this error to no avail. My program is not doing any
decrypting, I am not on a web farm, I have reset the web server. The website
is internal, not on internet.

Exception Thrown

Module:
http://intranet/WebResource.axd?d=_9PVU2juk255_dSftXLwlg2&t=632967410635716438

Exception Information: 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)

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)
bruce barker - 12 Jul 2007 17:16 GMT
WebResource.axd is a builtin handler that returns resource strings.
asp.net returns javscript and builtin images this way. to keep anyone
from reading any resource string, you pass an encrypted request args
(there is an api to generate this).

because the encryption key is regenerated at startup, a recycle can
cause this error. check the error log for recycle events.

-- bruce (sqlwork.com)

> Ok, I have an internal intranet website created in visual studio 2005, c#.
> It was running fine for months, and then all of the sudden a few days I
[quoted text clipped - 39 lines]
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously)
Peter Bromberg [C# MVP] - 12 Jul 2007 17:30 GMT
The way to solve this issue (mandatory if on a web farm) is not to use the
"autogenerated=true" attribute in the machineKey element. Generate your own
keys and have them specified, they must be the same on every machine.
-- Peter
Site:  http://www.eggheadcafe.com
UnBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA):    http://www.blogmetafinder.com

> Ok, I have an internal intranet website created in visual studio 2005, c#.
> It was running fine for months, and then all of the sudden a few days I
[quoted text clipped - 39 lines]
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.