473,394 Members | 2,002 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,394 software developers and data experts.

Problem with decrypt/encrypt

Im trying to encrypt a string in asp.net. Post the encrypted string
thru a form. Recive the encrypted string on a classic asp page and
decrypt it there.

I get a error saying "Padding is invalid and cannot be removed". It
works perfect on my localhost (running XP SP2) but i get that error on
my Windows 2000 server.

Anyone have any idea why this happens? I guess something strange is
happen when i post the form. But i have checked the strings that is
sent and they look the same. But mabye it can have something to do with
the page in some way? Well .. give me some ideas :)

Br, Ola

Nov 19 '05 #1
4 1650
Stuckish,

..NET has a request validator built into it that stops a post with illegal
characters in it. Does the encrypted string contain any characters that
would be considered illegal by .NET?

To turn off request validation for a page place validateRequest=false in the
page directive like this:

<%@ Page Language="vb" validateRequest=false AutoEventWireup="false"
Codebehind="default.aspx.vb" Inherits="AboutFortunate._default1"
smartNavigation="True"%>

I'm not positive if this will solve your problem, but it's something to try.
If it does work be careful though. You should really validate the
information being sent to your form yourself if you have removed the built
in validation.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<st******@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Im trying to encrypt a string in asp.net. Post the encrypted string
thru a form. Recive the encrypted string on a classic asp page and
decrypt it there.

I get a error saying "Padding is invalid and cannot be removed". It
works perfect on my localhost (running XP SP2) but i get that error on
my Windows 2000 server.

Anyone have any idea why this happens? I guess something strange is
happen when i post the form. But i have checked the strings that is
sent and they look the same. But mabye it can have something to do with
the page in some way? Well .. give me some ideas :)

Br, Ola

Nov 19 '05 #2
If he is posting to a legacy ASP page, then validation would not be an
issue.

The error makes it sound like you are encrypting it using a different
algorithm then you are decrypting it with. Make sure the algorithms are the
same and that the key and key lengths are the same.

What component on legacy ASP are you using to decrypt?

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:eX**************@TK2MSFTNGP09.phx.gbl...
Stuckish,

.NET has a request validator built into it that stops a post with illegal
characters in it. Does the encrypted string contain any characters that
would be considered illegal by .NET?

To turn off request validation for a page place validateRequest=false in
the page directive like this:

<%@ Page Language="vb" validateRequest=false AutoEventWireup="false"
Codebehind="default.aspx.vb" Inherits="AboutFortunate._default1"
smartNavigation="True"%>

I'm not positive if this will solve your problem, but it's something to
try. If it does work be careful though. You should really validate the
information being sent to your form yourself if you have removed the built
in validation.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<st******@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Im trying to encrypt a string in asp.net. Post the encrypted string
thru a form. Recive the encrypted string on a classic asp page and
decrypt it there.

I get a error saying "Padding is invalid and cannot be removed". It
works perfect on my localhost (running XP SP2) but i get that error on
my Windows 2000 server.

Anyone have any idea why this happens? I guess something strange is
happen when i post the form. But i have checked the strings that is
sent and they look the same. But mabye it can have something to do with
the page in some way? Well .. give me some ideas :)

Br, Ola


Nov 19 '05 #3
Oops. Missed that. Thanks for catching that Peter.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:en**************@TK2MSFTNGP09.phx.gbl...
If he is posting to a legacy ASP page, then validation would not be an
issue.

The error makes it sound like you are encrypting it using a different
algorithm then you are decrypting it with. Make sure the algorithms are
the same and that the key and key lengths are the same.

What component on legacy ASP are you using to decrypt?

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:eX**************@TK2MSFTNGP09.phx.gbl...
Stuckish,

.NET has a request validator built into it that stops a post with illegal
characters in it. Does the encrypted string contain any characters that
would be considered illegal by .NET?

To turn off request validation for a page place validateRequest=false in
the page directive like this:

<%@ Page Language="vb" validateRequest=false AutoEventWireup="false"
Codebehind="default.aspx.vb" Inherits="AboutFortunate._default1"
smartNavigation="True"%>

I'm not positive if this will solve your problem, but it's something to
try. If it does work be careful though. You should really validate the
information being sent to your form yourself if you have removed the
built in validation.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<st******@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Im trying to encrypt a string in asp.net. Post the encrypted string
thru a form. Recive the encrypted string on a classic asp page and
decrypt it there.

I get a error saying "Padding is invalid and cannot be removed". It
works perfect on my localhost (running XP SP2) but i get that error on
my Windows 2000 server.

Anyone have any idea why this happens? I guess something strange is
happen when i post the form. But i have checked the strings that is
sent and they look the same. But mabye it can have something to do with
the page in some way? Well .. give me some ideas :)

Br, Ola



Nov 19 '05 #4
No, the validation is not the issue.

I use my own decrypt/encrypt dotnet component both from ASP and ASP.NET
(built with help from this article
http://www.dotnetthis.com/Articles/Crypto.htm). And it works fine to
encrypt and decrypt if i use .net "on both sides". Although i haven't
tried to post it with a form an decrypt it on the other side (with
asp.net).

The strange thing is that it works on my localhost but not on my
server. I can't say thou that im 100% sure that i use the exact same
version of my decrypt/encrypt component on my server. But i cant
remeber that i have changed it. And i cant update it now because it is
looked by my server and i dont want to do a iisreset right now.

I guess i have to try some more the next time i should reboot the
server ..

Nov 19 '05 #5

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

Similar topics

7
by: Carl Waldbieser | last post by:
I tried to adapt the instructions for building the M2Crypto module (http://sandbox.rulemaker.net/ngps/m2/INSTALL.html) to build a version compatible with Python2.3, but I've had some mixed results....
4
by: Spikinsson | last post by:
I'm looking for a good decrypt/encrypt function, all I want is a function in this form: char* encrypt(char* normal) { ... return encrypted; } and
8
by: toupeira23 | last post by:
Hello, I'm trying to encrypt passwords in my app. After discovering that there's no simple function to do this, I wrote a wrapper class which decodes a string using UTF8, encrypts it with...
1
by: PatCPA | last post by:
Can someone help me with this? I'm new to C++. Here's my problem. I am to prompt the user to either 'e' encrypt or 'd' decrypt a 4-digit number. Each 4 digit number is to be replaced by the sum...
4
by: cfor | last post by:
hi sir/mem, Please solve my problem "Decrypt md5 encrypted string.".
1
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
2
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
4
by: Grant | last post by:
I am trying to write a program in VB.NET that exchanges both strings and files with a ColdFusion web server which is running on Debian. I attempted to do so with the Chilkat...
2
by: Dandirom | last post by:
Hi guys, I need help. I'd appreciate any pointers on how to go about with this problem. Thanks a lot. Using arrays and/or pointers, make a prog that will ask for a string. 2 user-defined...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.