method for retrieving values from INI file (but encrypted)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Omar

    method for retrieving values from INI file (but encrypted)

    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.


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: method for retrieving values from INI file (but encrypted)

    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.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nick(dot)paldin o=at=exisconsul ting<dot>com

    "Omar" <none> wrote in message news:O4LORHcjDH A.1708@TK2MSFTN GP12.phx.gbl...[color=blue]
    > 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[/color]
    info.[color=blue]
    > 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.
    >
    >[/color]


    Comment

    Working...