Results 1 to 3 of 3

Thread: [RESOLVED] How do you all encrypt connection strings in WEB.CONFIG?

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Resolved [RESOLVED] How do you all encrypt connection strings in WEB.CONFIG?

    How do you all encrypt connection strings in WEB.CONFIG?

    TIA.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: How do you all encrypt connection strings in WEB.CONFIG?

    Found this link - and it worked perfectly

    https://techcommunity.microsoft.com/...on/ba-p/830094

    Run Command Prompt as Administrator

    Go to C:\Windows\Microsoft.NET\Framework\v4.0.30319

    Perform the command below to encrypt the connection string in your web.config:

    ASPNET_REGIIS -pef "connectionStrings" "D:\inetpub\wwwroot\applicationFolder"

    Open web.config and check if the connection string is encrypted

    Test the site

    If you want to decrypt it back, run this command:

    ASPNET_REGIIS -pdf "connectionStrings" "D:\inetpub\wwwroot\applicationFolder"

    Open the web.config and check if the connection string is decrypted

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,594

    Re: [RESOLVED] How do you all encrypt connection strings in WEB.CONFIG?

    This is what I used to do when I worked with asp.net
    Note that I remember that this could work also with app.config but it's been sometimes so I'm not saying this with 100% certainty.
    Also note that I'm not sure that you can decrypt on another server machine like that, so you might also want to read this:
    https://docs.microsoft.com/en-us/pre...ectedfrom=MSDN
    https://social.msdn.microsoft.com/Fo...csharplanguage
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width