How to secure password in code c# email client

早过忘川 提交于 2019-12-05 15:41:43

SMTP (protocol underlying email) requires that the password be provided in plain text.

You are already securing the communication channel, which should prevent interception of the email password on the wire.

You can place the password itself into an encrypted element of web.config to protect it at rest.

Finally, consider an account used only for this purpose. Forward email from that account to your brother's account. If the password is compromised, delete the account and create a new forwarding account.

Details for the System.Net smtp email objects can be set in the app.config or web.config

http://msdn.microsoft.com/en-us/library/w355a94k(v=vs.90).aspx

IF you set your password in the config file you can then encrypt that section to prevent cursory reading of your password. But ultimately the password needs to be provided as a string.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!