I have to encrypt XML file and send in ne开发者_如何学Ctwork to place in a private server. My other application will decrypt and import to SQL the file by giving the actual Public key.
Could you please suggest me best way for this.
File: XML Type
Possible size: Up to 250 MB Technology: C#.NET 2008Use XML encryption. It is supported directly in .NET through the EncryptedXml class.
There is an example on MSDN here: How to: Encrypt XML Elements with Asymmetric Keys.
Note that you should use the public key to encrypt and the private key to decrypt (and not the other way around as you wrote in the question).
Upload the file using SSL/TLS (e.g., with HTTPS or a Socket+SslStream) and let the server require the client to present an X.509 client certificate.
I would suggest using the RijndaelManaged class. This is a good example of its use.
Here is more the AES Algorithm.
精彩评论