在客户端/服务器应用程序中加密/解密 SMTP 密码

发布于 2024-07-18 02:35:59 字数 203 浏览 7 评论 0原文

我有一个客户端应用程序需要保存 SMTP 服务器的用户名/密码。 这些数据将进入 SQL Server 2005,并由我的服务器应用程序使用。 服务器应用程序将使用 System.Net.Mail 命名空间,通过提供的凭据(并从该用户的电子邮件地址)发送电子邮件。 如何轻松/安全地加密/解密密码,以免纯文本密码通过网络传播? 请注意,不保证客户端和服务器应用程序位于同一台计算机上。

I have a client app that needs to save a username/password for an SMTP Server. This data will be going into SQL Server 2005, and consumed by my server app. The server app will use the System.Net.Mail namespace to send e-mail messages using the supplied credentials (and from that user's e-mail address). How can I encrypt/decrypt the password easily/securely so that I don't have plain-text passwords flying across the wire? Note that the client and server apps are NOT guaranteed to be on the same computer.

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

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

发布评论

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

评论(1

梨涡少年 2024-07-25 02:35:59

.NET 中有完整的加密命名空间 - System.Security.Cryptography (示例) 这样就可以在客户端对数据进行加密/解密。

现在如何存储密码的密钥。 这可以存储在 app.config 中,如所述加密 此处。 但请注意,如果用户具有计算机的管理员访问权限,他们可以解密存储在 app.config 中的密钥。

There is whole encryption namespace in .NET - System.Security.Cryptography (example) So you can encrypt/decrypt the data on the client.

Now how to store the key to the cipher. This can be stored in app.config encrypted as described here. Note though, that if the user has admin access to the machine, they can decrypt the keys stored in your app.config.

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