3.5 .Net框架加密问题
为了在用户 PC 中加密和存储我的客户端应用程序的密码,我找到了这个 MSDN 示例(为其他目的创建):
http://msdn.microsoft.com/en-us/library/bb397867(VS.90).aspx
为了增加安全性,我创建了一个每次应用程序启动时都会创建新文件。现在看来,有时在某些电脑上(到目前为止仅适用于 Windows XP),在创建或读取加密文件的过程中会出现问题,需要重新输入密码。我不太理解MSDN示例的代码(特别是“EncryptFile”和“DecryptFile”方法),那么我问你:根据你的经验,这段代码是否有可能在某些客户端安装中产生错误? 谢谢你! 皮莱吉
To crypt and store the password of my client-application in the user-pc I have found this MSDN example (created for other purposes):
http://msdn.microsoft.com/en-us/library/bb397867(VS.90).aspx
For added security I create a new file every time at the startup of the application. Now it seems that sometimes, on some pc (until now only with Windows XP), something goes wrong in the process of creating or reading the crypted file and it becomes necessary to re-enter the password. I don't understand deeply the code of the MSDN example (in particoular the methods "EncryptFile" and "DecryptFile") then I ask you: for your experience, is it possible that this code will generate errors in some client-installations?
Thank you!
Pileggi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用受保护的数据 API 来存储它。 1)它更容易使用,因为它只需一次调用,然后将返回的数据保存在某处 2)它更安全。无论您使用什么方式加密密码,都必须将密钥存储在系统上的某个位置,这并不安全。
另一方面,受保护的数据 api 从用户登录凭据中获取密码,因此密钥材料实际上不在系统上。
Use the protected data api to store this. 1) its way easier to use since its just one call and then save the returned data somewhere 2) It is way way more secure. No matter what you with encrypting the password, you have to store the key somewhere on the system, its not secure.
The protected data api, on the other hand, derives the password from the users log on credentials, so the key material is actually not on the system.