"System.Security.Cryptography.CryptographicException: Bad Data" Message

  • Thread starter Thread starter Robin Thomas
  • Start date Start date
R

Robin Thomas

I am working with the ASP.NET Starter Portal and I don't think it is
related.
Everyone once and a while, after a rebuild, I get the following error. I am
not doing anything with Cryptography, but the portal framework might be, but
I don't exatcly what it is trying to do.
Sometimes refreshing works and sometimes I have to rebuild and other times I
have to do an IISRESET.
Any ideas?
Thanks!


Bad Data.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: Bad
Data.

Source Error:

Line 124:
Line 125: // Get roles from roles cookie
Line 126: FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt(Context.Request.Cookies["portalroles"].Value);
Line 127:
Line 128: //convert the string representation of the role
data into a string array
 
Still looking for an resolution....
Robin Thomas said:
Any of have any ideas on this one? Thanks!
Robin Thomas said:
I am working with the ASP.NET Starter Portal and I don't think it is
related.
Everyone once and a while, after a rebuild, I get the following error.
I
am
not doing anything with Cryptography, but the portal framework might be, but
I don't exatcly what it is trying to do.
Sometimes refreshing works and sometimes I have to rebuild and other
times
I
have to do an IISRESET.
Any ideas?
Thanks!


Bad Data.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: Bad
Data.

Source Error:

Line 124:
Line 125: // Get roles from roles cookie
Line 126: FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt(Context.Request.Cookies["portalroles"].Value);
Line 127:
Line 128: //convert the string representation of the role
data into a string array
 
Found solution at
http://www.derkeiler.com/Newsgroups...t.framework.aspnet.security/2003-05/0146.html

In the specific case of the ASP.NET Starter Portal this worked for me:
<configuration>
[...]
<system.web>
[...]
<machineKey validationKey="AutoGenerate"
decryptionKey="AutoGenerate"
validation="MD5"/>

Hope this helps you.

David Roberts

Robin said:
I am working with the ASP.NET Starter Portal and I don't think it is
related.
Everyone once and a while, after a rebuild, I get the following error. I am
not doing anything with Cryptography, but the portal framework might be, but
I don't exatcly what it is trying to do.
Sometimes refreshing works and sometimes I have to rebuild and other times I
have to do an IISRESET.
Any ideas?
Thanks!


Bad Data.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details:
System.Security.Cryptography.CryptographicException: Bad
Data.

Source Error:

Line 124:
Line 125: // Get roles from roles cookie
Line 126: FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt(Context.Request.Cookies["portalroles"].Value);
Line 127:
Line 128: //convert the string representation of the role
data into a string array
 
Back
Top