Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encryption in Memory
Message
De
11/02/2004 15:17:18
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Encryption in Memory
Divers
Thread ID:
00876413
Message ID:
00876413
Vues:
46
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.
Répondre
Fil
Voir

Click here to load this message in the networking platform