Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Encryption in Memory
Message
From
11/02/2004 15:17:18
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Encryption in Memory
Miscellaneous
Thread ID:
00876413
Message ID:
00876413
Views:
47
I am trying to use DES encryption to encrypt a string and hold it in memory, then later to decrypt it.

To do this I am moving the string data into a byte array which is then encrypted using a memory stream. After encryption takes place, the encrypted data is moved back into a byte array to hold in memory. This "seems" to be working, i.e. I get no error in this routine.

Later, I then try to decrypt the data in the byte array holding the encrypted data by moving the encrypted data into a memory stream and passing it through the DES decryptor. A stream reader is created to read the data from the memory stream into a string variable using the stream reader ReadToEnd() method. It is on this statement that I get a "CryptographicException: Bad Data" error.

Has anyone seen this behavior and what the cure is? Is there another way to encrypt the string, hold it memory then decrypt it?

Thanks,
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Reply
Map
View

Click here to load this message in the networking platform