使用 .NET 将文件安全地复制到 UNC 路径

发布于 2024-12-08 17:35:35 字数 299 浏览 3 评论 0原文

我需要将文件从一台服务器复制到同一网络上的 UNC 路径。 ASP.NET 应用程序使用 .NET 2.0

目前我们只使用一个简单的 System.IO.File.Copy 方法,并且工作得很好,但我们被要求确保文件传输安全。

我可以想到两种方法来做到这一点。编写 WCF 或 ASMX 服务并在目标服务器上安装 SSL 证书并使用该证书,或者在调用 File.Copy 之前显式加密每个文件,然后在复制文件后解密该文件。

我是否缺少一个选项?有更好的方法来做到这一点吗?如果不是……哪个选项最适合我的要求?

提前致谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黯淡〆 2024-12-15 17:35:35

我最初担心的是,我的 LAN 中的某个人只需启动一个简单的工具即可获取在我的 LAN 上的服务器之间复制的文件的副本。

在 superuser.com 上提出相关问题后 - 可以通过 LAN 复制的文件会被嗅探吗?,我了解到,即使普通人能够启动 WireShark 等流行的嗅探工具并将其配置为查看通过网络复制的文件流,它也会不是将流转换回文件是一项简单的任务。做到这一点需要更高的技能。

但是,为了安全起见,我会加密流(通过 SSL 的 WCF 或 ASMX 服务),这样即使他们可以看到流,它仍然会被加密。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文