Re: Cryptography in ASP.NET stopped working

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Forcing the downloading of a file
    ... Our users will be receiving automated emails from a web server that will ... What I'd like to do is have a web servlet do the encryption for the users. ... the decryption, I want to "force" the file back to the user. ...
    (comp.lang.java.programmer)
  • FormsAuthenticationTicket in both ASP.NET app and Web Service
    ... I've got an ASP.NET web app which talks to a Facade layer exposed as Web ... could hold the encrypted ticket for the web service to digest. ... Only problem with this is that the encryption / decryption on the webapp is ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Auto-update protocol
    ... to transfer even with a single client and no interference. ... shared secret/public key is the only way to do the encryption. ... successfully decryption is the authentication. ... you can get using a generic farm server, but TFTP does not have any ...
    (comp.arch.embedded)
  • Re: Securing data to a process principal
    ... encryption key first time for the user - and use it later). ... secret. ... I need the decryption to ... You MAY think that instead of a filter driver you can simply ...
    (microsoft.public.platformsdk.security)
  • Re: embedded keys - there has to be a less vulnerable approach
    ... the database would be run on top of an encrypting file system ... > The use of an asymmetrical encryption algorithm does not seem to offer ... because the encryption and decryption ... > a hostile attacker is not a member of that small knowledgeable elite. ...
    (comp.security.misc)