CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP.NET - InMotion Framework

 How to handle encryption decription of connection string ?

Print topic Send  topic

Author Message
gatewaytl

Posts: 1
Posted: 10/16/2008, 1:13 AM

Hi Friends,

I have created two functions that encrypt and decrypt the connection string in web.config. But whenever I want to use connection string. I have to always decrypt web.config and then again encrypt it back. Does there any other way which i can use.

I'm using section.SectionInformation.ProtectSection(" <encryption configuration provider> ") and section.SectionInformation.UnprotectSection()
_________________
gatewaytechnolabs.com
View profile  Send private message
cvboucher

Posts: 191
Posted: 10/30/2008, 11:58 AM

I add the following code to the After Initialize event of my login page so the connection string will be encrypted. .Net automatically decrypts the conection string when it is needed.

Dim configFile As System.Configuration.Configuration  
Dim configSection As ConfigurationSection  
configFile = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)  
configSection = configFile.Sections("appSettings")  
If Not configSection.SectionInformation.IsProtected() Then  
   configSection.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider")  
   configFile.Save()  
End If

Craig
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.