Securely storing a password locally that is used for web service

家住魔仙堡 提交于 2019-12-07 04:18:44

问题


I have an application that authenticates against a third party web service by sending a username and password. At the moment I'm typing the password on a winform each time I start the application - but I need it to login automatically.

I'd like to store the username/password somewhat more securely than

Dim username as String = "username"
Dim password as String = "password"

I understand that I probably won't stop a determined hacker with access to my source code, but storing them as plaintext feels wrong.

I've found some similar questions on here but none that provide me with an answer I can use.

Edit: The web service isn't mine, it's an API that requires me to login to use.


回答1:


For client-side Windows apps there is a ProtectedData class, which

...provides protection using the user or machine credentials to encrypt or decrypt data

So as long as user's profile is safe, so are data items protected with this class. However, if user's password is reset (not changed by user himself), all data is effectively lost.



来源:https://stackoverflow.com/questions/5806664/securely-storing-a-password-locally-that-is-used-for-web-service

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