Encrypting web.config / FullText

Discussion in 'ASP.NET 2.0' started by Bruce, Aug 4, 2006.

  1. Bruce

    Bruce DiscountASP.NET Staff

  2. Just started using discount ASP.net. Everything seems pretty easy to use so far.

    Do you have any quick pointers on the easiest way to encrypt sections of the web.config file.

    Is there support for full text indexing in my database? I got some error (rightly so) about not being able to access msdb.

    Thanks

    Larry
     
  3. You can Encrypt some section of the web config such as the connectionStrings and AppSettings


    here is an example which I use on discount...


    Imports System.Web.Configuration


    Imports System.Web.Security


    Public Sub EncryptConnStr(ByVal protectionProvider As String, ByVal MyPath As String)Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration(MyPath)


    '---indicate the section to protect


    Dim section As ConfigurationSection = _


    config.Sections("connectionStrings")


    '---specify the protection provider


    section.SectionInformation.ProtectSection(protectionProvider)


    config.Save()


    End Sub


    Here is a link with more info

    kevinasp.com
     
  4. If you encrypt sections in the web.config programmatically, make sure that you run the script directly on web server. If you encrypt the web.config on your local development machine first and then upload the encrypted web.config to the live server, it will not work because the default protection providers use machine-specific encryption methods.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Thanks, these reply's are great. I knew I could do it, but this saved me the research time. Thanks again.
     

Share This Page