How to maintain plaintext passwords in ini file in C#.Net?

Prabs 1 Reputation point
2021-07-14T11:42:12.457+00:00

Hi Team,

I have .Net core console application which is running on linux platform.
I am using one .INI file for storing project specific information (like user name and password information etc.) While loading time, the application will parse the .INI file data and storing to memory class.

I need to secure my password information in .INI file. I don't want to use password in plaintext
How to handle it? Please help me on this.

Regards
Prabs

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,370 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,131 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Castorix31 82,036 Reputation points
    2021-07-14T12:07:51.267+00:00

    You can see old answered threads like Password encryption in dotnet
    (answer with CodeProject article...)

    0 comments No comments

  2. Karen Payne MVP 35,201 Reputation points
    2021-07-14T12:30:49.037+00:00

    Storing sensitive information such as a password is not wise as a savvy user can decompile your application and/or inspect data in memory.

    Example decompiling code with encryption methods.

    114624-figure1.png

    If you really want to do this see

    Cross-Platform Cryptography in .NET Core and .NET 5

    0 comments No comments

  3. Prabs 1 Reputation point
    2021-07-15T09:18:52.187+00:00

    I am maintaining SNMP V3 parameters in INI file as plain text.

    .INI FILE :

    [SNMP V3]
    SNMP_VERSION=3
    UserName=UNAME
    AuthPassword=authpwd
    AuthProtocol=SHA512
    PrivPassword=privpasswd
    PrivProtocol=AES256

    I don't want to allow other users modify this information. How to handle this?