如何在 .NET Core 控制台应用程序中安全地存储用户名和密码? [英] How to store username and password securely in .NET Core console app?

查看:42
本文介绍了如何在 .NET Core 控制台应用程序中安全地存储用户名和密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 .NET Core 控制台应用程序中,我需要安全地存储用户名和密码,以便在稍后运行应用程序时,我能够在不再次提示用户的情况下检索它.

In my .NET Core console app, I need to store a username and password securely such that when the app is run at a later point in time, I am able to retrieve it without prompting the user again.

控制台应用程序将在 Windows 下运行.

The console app will run under Windows.

在 Windows 程序中存储敏感信息的推荐方式是什么?

What is the recommended way to store sensitive information in a Windows program?

推荐答案

您可能需要查看 ProtectedData 类.这会对数据进行加密,使其除当前用户之外的所有人都无法访问.

You might want to take a look at the ProtectedData class. This encrypts the data to make it inaccessible for all but the current user.

请记住,保护数据不受用户本人的影响,特别是如果用户是管理员,如果用户技术熟练,很少会真正安全.

Keep in mind that protecting data from the user himself, especially if the user is an administrator, will rarely be truly secure if the user is skilled.

这篇关于如何在 .NET Core 控制台应用程序中安全地存储用户名和密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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