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 7534799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:07:21+00:00 2026-05-30T06:07:21+00:00

I am new to the encryption process and have tried unsuccessfully to install an

  • 0

I am new to the encryption process and have tried unsuccessfully to install an encrypted web.config file onto a hosting companies server. I am using Microsoft Visual Web Developer 2010 Express.

I have followed the steps located in Walkthrough: Encrypting Configuration Information Using Protected several times.

Please Note regarding the walkthrough, I do not have any machineKeys in my web.config file, so I skipped that encryption step.

When I Ran the aspnet_regiis -pef connectionStrings “c:\Users……\mywebsite.com”
Return is:
Encrypting configuration section …
Succeeded!

2) I then FTP my web.config file and the site gets the below error: Note: The Line 8 is highlighted)

Server Error in ‘/’ Application.

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Failed to decrypt using provider ‘RsaProtectedConfigurationProvider’. Error message from the provider: Bad Data.

Source Error:

Line 6:
Line 7:
Line 8:
Line 10:

Source File: C:\HostingSpaces*username**mywebsite.com*\wwwroot\web.config Line: 8


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1


I know there must be some piece missing but I have searched and have not found anything. I emailed the hosting company to find out if they need to do anything regarding encrypting web sites and they have not responded yet.

What I would expect is that there is a key that resides elsewhere which takes the encrypted value and decrypts it using an algorhythm. If this is so, where would I get that key and where would it go.

Any help is greatly appreciated and somewhat surprised I cannot find any issues similar to this on the web.

Thanks Much.

  • 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-05-30T06:07:23+00:00Added an answer on May 30, 2026 at 6:07 am

    Jonny O – Thanks. This worked so easily. CP

    I added the global.asax file and here are the code snippets that went into this file (global.asax.cs).

    Granted much of this is duplicated from above, but it is my entire solution. Thanks again.

    using System.Web.Configuration;
    using System.Configuration;
    using System.Web.Hosting;
    
        protected void Application_Start(object sender, EventArgs e)
        {
            //Test to see if this app is being started on the development machine (e.g. in the debugger)
            //This code will encript web.config the first time this program runs.
            //Therefore, it is important to have a backup copy of the non-encrypted web.config as this
            //code below will encrypt it, which is what we want to happen on the production server.            
            if (! System.Diagnostics.Debugger.IsAttached )
            {
                EncryptConfig();  //See below
            }
        }
    
    
    
        /// <summary>
        /// This technique of encrypting the web.config file was learned from this forum post:
        /// http://stackoverflow.com/questions/5602630/encrypting-web-config-and-installing
        /// </summary>
        private static void EncryptConfig()
        {
            System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(HostingEnvironment.ApplicationVirtualPath);
    
            foreach (string sectionName in new[] { "connectionStrings", "appSettings" })
            {
                ConfigurationSection section = config.GetSection(sectionName);
                if (!section.SectionInformation.IsProtected)
                {
                    section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
                }
            }
    
            config.Save();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to encryption. I have looked at the javax.crypto documentation and got
Hi I have read Glassfish 3.1.2's JDBCRealm has a new Password Encryption Algorithm field.
I have a large subset of encrypted word documents which i need to process
Here is the code I have so far... // Run the external encryption process
We are in the process of moving our web architecture to a new environment.
I am new to encryption. I need to keep a field encrypted in a
Possible Duplicate: Is SHA-1 secure for password storage? I am new to encryption and
New to PHP and MySQL, have heard amazing things about this website from Leo
We are adding AES 256 bit encryption to our server and client applications for
We have several systems with Oracle (A) and SQL Server (B) databases on backend.

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.