保护电子邮件而无需提示输入密码 [英] Secure email without prompting for password

查看:96
本文介绍了保护电子邮件而无需提示输入密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用BackupManager,在处理完所有任务后向我发送电子邮件.这封电子邮件应包含已完成的日志.

I'm currently working on a BackupManager sending an email to me after having processed all tasks. This email shall contain a log of what have been done.

问题是,我的电子邮件SMTP服务器(gmail)仅允许使用SSL进行加密连接.我知道如何建立这种连接,但是由于程序是从凌晨2点到8点或在相同的时间运行,所以我不想每次都输入密码.但是,我也不想将密码以纯文本格式保存在硬盘驱动器上.因此,我正在寻找一种方法来保存加密的密码,并在以后不进行提示或类似操作的情况下将其解密.

The problem is, that my e-mail SMTP server (gmail) only allows encrypted connections using SSL. I know how to establish such a connection, but as the program runs from 2 to 8 am or at at a similar time, I don't want to have to enter the password every time. However, I also don't want to save the password as plain text on the hard drive. So I'm looking for a method to save the password encrypted and decrypt it later without prompting or stuff like that.

感谢您的帮助,

图拉卡

推荐答案

我使用了Tomer Klein提出的使用ProtectedData的答案.只需使用ProtectedData.Protect(data, salt, scope)保护您的密码(以字节为单位),然后使用ProtectedData.Unprotect(data, salt, scope)取消保护它.完成操作后,请记住要从内存中删除密码,否则攻击者可能会从那里取回密码.

I've used the answer suggsted by Tomer Klein using ProtectedData. Just use ProtectedData.Protect(data, salt, scope) to protect your password in bytes and ProtectedData.Unprotect(data, salt, scope) to unprotect it. Remember to delete your password from memory once you are done, otherwise an attacker could retrieve it from there.

这篇关于保护电子邮件而无需提示输入密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆