How to store username and password securely in .NET Core console app?

Viewed 1044

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.

The console app will run under Windows.

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

1 Answers

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.

Related