Hi. I'm pretty new to encryption(ie. about three days of scratching my head) so forgive me if I am missing something obvious. Also, I am writing it in VB so, if the syntax is someway different to C#, apologies. Anyway, I am using an RSACryptoServiceProvider to encrypt some data and then to decrypt it. I thought that if I used .ToXmlString(false) to export just the public parameters then I could use .FromXmlString to create another RSACryptoServiceProvider which could be used to encrypt only. Unfortunately, this is telling me 'Bad Key'. The only way I can get it to work is by sending out the private key as well which kind of defeats the purpose.
Basically, what I want to do is:
1. Generate a public/private key pair.
2. Send the public key to another machine.
3. Have the other machine encrypt the data with the public key and send it back.
4. Decrypt it using the private key.
As far as I can see, this is exactly what public key encryption is designed for so why isn't that the way these libraries were designed? Thanks in advance for any help.
Durkin
Basically, what I want to do is:
1. Generate a public/private key pair.
2. Send the public key to another machine.
3. Have the other machine encrypt the data with the public key and send it back.
4. Decrypt it using the private key.
As far as I can see, this is exactly what public key encryption is designed for so why isn't that the way these libraries were designed? Thanks in advance for any help.
Durkin