473,395 Members | 1,870 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,395 software developers and data experts.

Enterprise Library - Cryptography

Hi,

I am trying to use the Entlib Cryptography block in an application.
I have two classes (Encrypt/Decrypt) that incorporates code from the
Quickstart exampele provided with entlib.

When trying to decrypt an encrypted string I get the following error:

'System.Security.Cryptography.CryptographicExcepti on' occurred in
mscorlib.dll
Additional information: PKCS7 padding is invalid and cannot be removed.

Does anybody know why this exception is thrown? Some sources on the Internet
indicates that it is due to the number of bytes in the chipertext. But
shouldn´t Entlib Configuration Console take care of everything for me??

Regards
/Oscar
Nov 17 '05 #1
1 3035
I'm not sure if you are having these problems, but I have solved a similar
problem that has been troubling me all afternoon....

1. Check the IV is the same in the decrypt as encrypt (I am sure you already
know this).

2. If you are converting bytes to text using an ASCIIEncoder, or any other
8-bit encoder, it will only convert using 8-bits, i.e. a byte value of 129
will become 1!!

I had this problem because the MSDN sample uses an ASCII encoder! How
annoying!!!!! I hope this helps.

"Oscar Thornell" wrote:
Hi,

I am trying to use the Entlib Cryptography block in an application.
I have two classes (Encrypt/Decrypt) that incorporates code from the
Quickstart exampele provided with entlib.

When trying to decrypt an encrypted string I get the following error:

'System.Security.Cryptography.CryptographicExcepti on' occurred in
mscorlib.dll
Additional information: PKCS7 padding is invalid and cannot be removed.

Does anybody know why this exception is thrown? Some sources on the Internet
indicates that it is due to the number of bytes in the chipertext. But
shouldn´t Entlib Configuration Console take care of everything for me??

Regards
/Oscar

Nov 17 '05 #2

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

Similar topics

8
by: poifull | last post by:
Is anyone using the Microsoft Enterprise Library? If yes, do you like it or not? Any feedback will be appreciated.
3
by: veera sekhar kota | last post by:
hi, im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked...
0
by: veera sekhar kota | last post by:
im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked me to...
0
by: veera sekhar kota | last post by:
im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked me to...
0
by: Benny Ng | last post by:
Hi,All, When i deploy Enterprise library with my application ,i used XCOPY to deploy it into my test server. But when application runs, shown some error related registry. (But actually I haven't...
7
by: rockdale | last post by:
hi, I just downloaded Microsoft Enterprise Library Jan 2006 and try to integrate it into my asp.net application. As i am going to connect to mySQL database, I need to include the source code in my...
1
by: Jess Chadwick | last post by:
I am attempting to use the Enterprise Library (Jan 2006) Cryptography block to encrypt a credit card number in my ASP.NET 2.0 Commerce Server application. Everything is configured correctly, as...
1
by: GaryDean | last post by:
I now have installed (from the same install) Enterprise Library - January 2006 and Enterprise Library - June 2005. The install for these two was called Enterprise Library for .Net 2.0. (not...
1
by: =?Utf-8?B?QnJpYW4gTmllbHNlbg==?= | last post by:
Hi I'm trying to use the Cryptography application block within a web application and have encountered a problem that I hope you can help resolve. 1. When I create a key file through...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
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,...

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.