method for retrieving values from INI file (but encrypted)

  • Thread starter Thread starter Nicholas Paldino [.NET/C# MVP]
  • Start date Start date
N

Nicholas Paldino [.NET/C# MVP]

Omar,

You can use the API functions through the P/Invoke layer to read and
write from the INI file. However, you might want to try an XML file
instead.

Either way, once you have your information (from the XML or INI file),
you can use the classes in the System.Security.Cryptography namespace to
encrypt and decrypt your data. However, you will have to store the private
key somewhere that people can not see it. Because your code can be
decompiled, getting the private key would be easily done. You might want to
consider writing an unmanaged DLL which will return the private key to you.
While hackers can still get around this, it would be much harder than
someone looking into the managed code.

Hope this helps.
 
My app has to be able to read values from an external configuration file
(preferably an INI). The problem is that this INI file will contain secure
information (eg. SQL server authentication) and, since an INI is a text
file, anybody that opens the file will be able to read this sensitive info.
Is there any other I method that I can use that'll let the user change
between databases but that the info is more secure?
This file will contain many configuration parameters so it needs to be
external.

Thanks again.
 
Back
Top