Re: Cryptography in ASP.NET stopped working
- From: "landers" <landley_darlington@xxxxxxxxxxx>
- Date: Thu, 12 Oct 2006 23:41:58 +0100
Sorted now thanks.
For some bizarre reason the encryption routine used UTF8 and the decryption
ASCII!
Landers
"landers" <landley_darlington@xxxxxxxxxxx> wrote in message
news:%23D%23Hdb%236GHA.940@xxxxxxxxxxxxxxxxxxxxxxx
Dear Fellow Developers,
There is a little bit of code in my web app that encrypts a string,
converts it to base64 string and uses it as a querystring parameter. It
then redirects to this new url. The target url gets this encrypted
parameter (not using Request.QueryString as it replaces the + for a space)
and converts from base64 to normal string then decrypts.
This has been running happily since January this year. There have been no
code changes so the encrypted and decrypted results should be the same.
The web server has recently been upgraded to .NET Framework 2.0, and since
this upgrade odd things have been happening.
I have a copy of the web app on two web servers (dev and live). The dev
server is running .NET 1.1 only and the live .NET 1.1 and 2.0. When I run
the same code against the two servers, I get two slightly different
encrypted strings. The string returned on the .NET 2.0 server is about 16
characters longer. It appeared to add 4 characters in 4 different places.
Consequently, the following exception is thrown:
System.Security.Cryptography.CryptographicException: Length of the data to
decrypt is invalid.
at
System.Security.Cryptography.CryptoAPITransform.TransformFinalBlock(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount)
Any ideas?
Landers
.
- References:
- Cryptography in ASP.NET stopped working
- From: landers
- Cryptography in ASP.NET stopped working
- Prev by Date: Help constructing a class !
- Next by Date: Re: Help constructing a class !
- Previous by thread: Cryptography in ASP.NET stopped working
- Next by thread: .NET Framework Version
- Index(es):
Relevant Pages
|