title: Encrypting Web.config and installing
body: <p>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.</p>
  
  <p>I have followed the steps located in <a href="http://msdn.microsoft.com/en-us/library/dtkwfdky.aspx" rel="nofollow">Walkthrough: Encrypting Configuration Information Using Protected </a> several times.</p>
  
  <p>Please Note regarding the walkthrough, I do not have any machineKeys in my web.config file, so I skipped that encryption step.</p>
  
  <p>When I Ran the aspnet_regiis -pef connectionStrings "c:\Users......\mywebsite.com"<br>
  Return is:
  Encrypting configuration section ...
  Succeeded!</p>
  
  <p>2) I then FTP my web.config file and the site gets the below error:  Note: The Line 8 is highlighted)</p>
  
  <h2>Server Error in '/' Application.</h2>
  
  <p>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. </p>
  
  <p>Parser Error Message: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: Bad Data.</p>
  
  <p>Source Error:  </p>
  
  <p>Line 6:  
  Line 7:    
  Line 8:      
  Line 10:       </p>
  
  <p>Source File: C:\HostingSpaces*username**mywebsite.com*\wwwroot\web.config    Line: 8 </p>
  
  <hr>
  
  <p>Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 </p>
  
  <hr>
  
  <p>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.</p>
  
  <p>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.  </p>
  
  <p>Any help is greatly appreciated and somewhat surprised I cannot find any issues similar to this on the web.</p>
  
  <p>Thanks Much.</p>