473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to encrypt/decrypt app.config for WinForm

I'm working with Visual Studio 2008 Pro SP1, .Net 3.5 SP1, on Windows XP box.
I have created a Windows application that will be distributed to multiple users over the Internet, well at least that was the plan, until I realized my app.config file exposes the connectionString information to anyone to see.

I had been trying to follow a solution, provided by Steven Cheng, from a 07/2006 question asked on this forum titled "Encryption of application configuration block", which suggested using aspnet_regiis to create a custom RSA key that is supposed to allow me to encrypt my app.config on my development box; and provide a means to include a decryption routine within my deployment package.

To be honest, I'm not getting it??? First of all, creating the RSA key is anything but simple. For example, when I run the aspnet_regiis command as stated in the Microsoft documentation, http://msdn.microsoft.com/en-us/library/2w117ede.aspx, the Help screen scrolls by, as if my command syntax is wrong??

Secondly, this particular document is approaching the question as if I were working with an ASP.Net application as opposed to a Windows Form app.

All I want is to figure out how to encrypt the connectionString section of the app.config file; and figure out how to decrypt the connectionString section (on-the-fly) when a user uses my application on their computer.

I would really appreciate step-by-step guidance in resolving this problem.

Thanks in advance
Jul 19 '10 #1
2 3555
ThatThatGuy
449 Expert 256MB
@Gary Gorman
If you have the RSA encryption code ...
Then use it to encypt the connection string and store it in app.config..

Then while using it in the application get the string and decrypt it.. as simple as that
Jul 19 '10 #2
Thanks for the quick reply ThatThatGuy!

I did not to that point of receiving the encryption code. As I stated, while trying to run the aspnet_... command the resulting action was the screen scrolled by as if I had some sort of syntax error.

But if I am successful generating the RSA code are you saying I simply cut & paste it into the app.config file?

If you would please provide me with an example of what you are saying.

Also, I forgot mention in my origial post, my SQL server is on a shared hosting service and I do not have access to its command prompt to run the aspnet_... command to Grant access to the account user.
Jul 19 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Benoît | last post by:
Hi, I have generated two keys : "C:>openssl req -nodes -new -x509 -keyout ben.key -out ben.crt -days 3650" I try to encrypt/decrypt a string like "JOHN" with these asymetrics keys. With the...
8
by: wkodie | last post by:
I'm having trouble encrypting/decrypting a simple string using the System.Security.Cryptography.TripleDESCryptoServiceProvider, etc... The encryption works, but the decryption does not properly...
0
by: Aaron | last post by:
Is the native Encrypt/Decrypt functionality with .NET PGP compatible?
4
by: Hrvoje Voda | last post by:
Does anyone knows a good example of how to encrypt/decrypt a string? Hrcko
3
by: Sushant Bhatia | last post by:
Hi All, I am trying to do encryption/decryption with RSA. For encryption, I use the public key. For decryption, I use the private key. The idea is to take a 80 byte array and encrypt it and then...
1
by: Microsoft | last post by:
Hi I'm not able to find a newsgroup for classic asp so I'm writing here hoping someone can help me So, I have to encrypt and also decrypt some user passwords I know md5 algoritm is a one way...
7
by: Jean Christophe Avard | last post by:
Hi! I am designing an application wich comes with image file. These images are copyrighted and they have to be accessible only from within the application. At first, I tought I was going to store...
4
by: Max Vit | last post by:
Here is my problem: I have an application built in Access that outputs sensitive data to a text file. I would like to encrypt this data *whilst* the file is being outputted. The encryption I was...
0
by: zeenets | last post by:
I am using Enterprise library v3.1 for developing a windows application. its working well. but there is a security issue, when i deploy this application on client machine the...
2
bferguson94
by: bferguson94 | last post by:
Design a program that allows the user to encrypt or decrypt a file. This means you will need to ask the user the direction to shift (left or right) and the number of places to shift (should they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.