473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Cryptography in ASP.NET stopped working

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.CryptographicExceptio n: Length of the data to
decrypt is invalid.
at
System.Security.Cryptography.CryptoAPITransform.Tr ansformFinalBlock(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount)

Any ideas?

Landers
Oct 9 '06 #1
1 1152
Sorted now thanks.

For some bizarre reason the encryption routine used UTF8 and the decryption
ASCII!

Landers

"landers" <la****************@hotmail.comwrote in message
news:%2*******************@TK2MSFTNGP03.phx.gbl...
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.CryptographicExceptio n: Length of the data to
decrypt is invalid.
at
System.Security.Cryptography.CryptoAPITransform.Tr ansformFinalBlock(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount)

Any ideas?

Landers

Oct 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Apple | last post by:
Hi guys, I am working on my java cryptography assignment. I am looking for the popular or the best cryptography softwares either wrote in java or not to encrypt/decrypt files using DES/RSA...
4
by: Niel | last post by:
Hello friends, I am not sure if i am posting to the correct group but if anyone has an idea about this and the possible solution or the link to that solution then please let me know We have out...
12
by: Beer | last post by:
Hello Everyone, We have been getting the EventID 7031 errors ever since we installed SP 3. We have been searching for any possible solution, but not much luck. We are running Windows 2000...
2
by: Dag Sunde | last post by:
I have the following code fragment in one of my pages: if (typeof document.getElementById('myApplet').getTableAsSDV != 'undefined') { rowBuffer =...
0
by: Andrzej | last post by:
Hi, I have to figure out why we have a problem with special characters in encrypted usernames and passwords. Case: Username: r&bgeorge Password: tigger
0
by: EP | last post by:
I have a WSE server app that uses the <cryptography> element in the configuration (seen below). This worked perfectly in WSE sp1, but when I upgraded to SP2 and then to SP3, I get the following...
1
by: muthu | last post by:
Hi, I have two web applications running on my machine.The application is developed using asp.net 1.1 and vb.net.When i try to run both the applications in the same browsers, i get the following...
1
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Hi, everybody here. I am implementing data encryption/decryption, and try to use System.Security.Cryptography.TripleDESCryptoServiceProvider. But I can not find it in MS Visual Studio when I...
1
by: rickcasey | last post by:
I wonder if anyone has experienced something like this, as it seems truly bizarre and is causing me to tear out my hair (what little there is left of it).... The exec() function just suddenly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.