Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8308041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:40:45+00:00 2026-06-08T18:40:45+00:00

I want to encrypt my appSettings and ConnectionStrings that located on my web.config file.

  • 0

I want to encrypt my appSettings and ConnectionStrings that located on my web.config file.

But since I’m using a shared hosting, I can’t use aspnet_regiis.exe method.

Is there any other way to encrypt web.config file? (an online tool, a remote tool, a programming way, or…)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:40:47+00:00Added an answer on June 8, 2026 at 6:40 pm

    Not tested by me, from CodeProject, hope that it will work
    Aspx Code:

     <asp:Button id="btnEncrypt" runat="server" Text="Encrypt" onclick="btnEncrypt_Click" />
     <asp:Button ID="btnDecrypt" runat="server" Text="Decrypt" onclick="btnDecrypt_Click" />
    
     Code Behind:
    
        string provider = "RSAProtectedConfigurationProvider";
        string section = "connectionStrings";
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void btnEncrypt_Click(object sender, EventArgs e)
        {
           Configuration confg = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
           ConfigurationSection configSect = confg.GetSection(section);
           if (configSect != null)
           {
              configSect.SectionInformation.ProtectSection(provider);
              confg.Save();
           }
        }
    
        protected void btnDecrypt_Click(object sender, EventArgs e)
        {
           Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
           ConfigurationSection configSect = config.GetSection(section);
           if (configSect.SectionInformation.IsProtected)
           {
              configSect.SectionInformation.UnprotectSection();
              config.Save();
           }
        }
    

    http://www.codeproject.com/Tips/304638/Encrypt-or-Decrypt-Connection-Strings-in-web-confi

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any section in my web.config file that I want to encrypt I run this
I want to encrypt the connectionstrings in my web.config. And my application will be
I want to encrypt a file using openssl. I can do it by using
We want to encrypt all our web app configuration files that we deploy to
I want to encrypt a URL variable so that the user can't see the
I want to encrypt a filename but ensure that the encrypted filename doesn't contain
I want to encrypt and decrypt a file containing usernames and passwords. Since this
I want to encrypt a XML file in Wpf to 128 bit. Can anyone
I am using visual studio 2010 my project is that, i want to encrypt
I want to encrypt a text file using AES encryption. However,I am not so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.