473,473 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.
Nov 15 '05 #1
1 2798
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)paldino=at=exisconsulting<dot>com

"Omar" <none> wrote in message news:O4**************@TK2MSFTNGP12.phx.gbl...
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.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: chris | last post by:
I'm writing a small app to help me learn more about cryptography. All it does is encrypt all of the files in directory A, and put the encrypted versions of the files in directory B. It then...
4
by: Debbie Carter | last post by:
Would anyone know how to read the file attributes of a file on the hard drive to check if the file is encrypted or not? I have searched Visual Studio Help and MSDN and the samples I have found do...
5
by: ~~~ .NET Ed ~~~ | last post by:
Anybody has any idea why this simple thing is not working? I pass a text file as input to encrypt it, then pass the encrypted version to the same function and get some garbled data not at all...
3
by: phforum | last post by:
I have no ideas to encrypt the user input password from the text box.....
5
by: Earl | last post by:
I need to call a method on an owned child form, and am wondering if the best way of doing this is to capture the Closing event of the form that passes control back to the form where I have the...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
2
by: prabu507 | last post by:
hi , please if u know the answer reply ..... the question is i m having a form and a button control if i enter the password field then after clicking the...
1
by: gubbachchi | last post by:
Hi, I have written a php code to retrieve the image from the mysql database but I am getting the encrypted value. How to convert it into image and display it on the webpage. Here is the code to...
4
by: Brian | last post by:
HI, I have two sets of data, the largest set of data contains 370 rows... both sets only have two columns. I want to be able to distribute the data with my applaction. The other option, would be...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.