views:

192

answers:

3

I have to encrypt XML file and send in network 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 2008

+2  A: 

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.

dtb
A: 

I would suggest using the RijndaelManaged class. This is a good example of its use.

Here is more the AES Algorithm.

SwDevMan81
thanks SwDevMan81,Is it possible to encrypt Xml file and at the time of opening it should asked for decrypt key..?
karthik
karthik - Not exactly sure what you are asking. You will need to maintain the key somehow that was used for encrypting the file in the first place. That same key will be needed to decrypt the file.
SwDevMan81
+4  A: 

Use 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).

Rasmus Faber