Search code examples
securityencryption.netfile-copying

Securely copy files to a UNC path using .NET


I need to copy files from one server to a UNC path on the same network. The ASP.NET app uses .NET 2.0

Currently we're just using a simple System.IO.File.Copy method, and works just fine, but we were asked to make sure the files are transferred securely.

I can think of two ways to do this. Either writing a WCF or ASMX service and install a SSL certificate on the target server, and use that, or, explicitly encrypting each file before calling File.Copy, and then decrypting the file once it's copied.

Am I missing an option? Are there better ways to do this? If not...which option would be best for my requirement?

thanks in advance.


Solution

  • My initial concern was that a person in my LAN could just launch a simple tool and get a copy of the files being copied between servers on my LAN.

    After asking a related question on superuser.com - can a file being copied over my LAN be sniffed?, i learned that even if a regular person is able to launch a popular sniffer tool like WireShark and configure it to see the stream of the files being copied over the network, it would not be an easy task to convert that stream back into a file. It would take a higher skill to do that.

    However, for safety, I'd go with encrypting the stream (WCF or ASMX service over SSL) so that even if they can see the stream, it'd still be encrypted.