RSACryptoServiceProvider Encrypt and Decrypt

May 12 2005 7:08 AM
Hi... I want to Encrypt and Decrypt a stream of data using the RSACryptoServiceProvider. But the problem is that it throws an error saying: "Bad Length". Heard that there is a limit to the KeySize. How can I overcome it? Tried the overloaded constructor: RSACryptoServiceProvider RSA = new RSACryptoServiceProvider((int)dataStream.Length * 8); //dataStream, a MemeoryStream object containing the data. But no use.. Any help? Regards, Ganesh.

Answers (4)