question

Prabs-7622 avatar image
0 Votes"
Prabs-7622 asked cleric145-6909 commented

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

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

dotnet-csharpdotnet-runtime
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
0 Votes"
Castorix31 answered

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


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered karenpayneoregon edited

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



figure1.png (115.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Prabs-7622 avatar image
0 Votes"
Prabs-7622 answered cleric145-6909 commented

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?


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You already got an answer with the excellent Codeproject article

0 Votes 0 ·