As far as I know, public/private key cryptology is supposed to allow for
data to be encrypted by either key and decrypted with the other key.
Given this, why is it that everyingthing in .NET (as far as I can see) only
allows for encrypting data using a public key? Surely there are situations
where encrypting data with a private key is useful. I fully understand public
key encryption's usefullness for passing a symetric key, but here's my
situation.
I have clients running an app. I want to send them some data. I do not care
who reads this data. I only care about 2 things.
1) No one but me could have written that data.
2) The data can not be altered without being corrupted.
Encrypting said data using my private key seems it would do just that. But
how do I use .NET to do so?
Thanks in advance
"Tyler Laing" <Tyler...@discussions.microsoft.com> wrote in message
news:C799B7A9-9DB0-40D3...@microsoft.com...
RSACryptoServiceProvider csp = new RSACryptoServiceProvider();
byte [] encryptedData = csp.EncrpytValue(yourData)
string rsaObj = csp.ToXmlString(false); // export RSA object with
private key
Best regards,
Sergey Bogdanov
Thanks
1) No one but me could have written that data.
2) The data can not be altered without being corrupted.
The sender has a private key, the recipient has a public key. Before the
sender will send data it uses SignData method to approve that he is
correct author and no one can't modify this data (otherwise a
verification of signature will fail). When the recipient will recieved
data it must call VerifyData to ensure that no one modify this data.
HTH,
Sergey Bogdanov
http://www.sergeybogdanov.com
Perhaps I could sign a hash, then send the original data along with the
signed hash. That would be enough to verify that the data is valid and that
it was sent from me.
Thanks
So I would need to send the original data along with the signed hash, the
client could read the original data and also verify it thus satisfying my
requirements.
Thanks