Problems with CryptoStream

  • Thread starter Thread starter karthy84
  • Start date Start date
K

karthy84

When i decrypt data using TripleDESCryptoServiceProvider, it throws
"System.Security.Cryptography.CryptographicException: Bad Data." error

help me please...
 
Hello,
When i decrypt data using TripleDESCryptoServiceProvider, it throws
"System.Security.Cryptography.CryptographicException: Bad Data." error

Sounds like either your encryption and decryption settings are not exactly
the same, or you are not properly closing/flushing the encryption stream.
Closing the CryptoStream is important because otherwise all of the encrypted
data is not actually written to the output file.

Here's an example of using TripleDESCryptoServiceProvider:

http://msdn2.microsoft.com/en-us/li...hy.tripledescryptoserviceprovider(vs.80).aspx

Try if the above code works for you, and if so, then check to see what's
different in your own code.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top