Click to See Complete Forum and Search --> : How to encrypt web.config on a shared hosting (web.com)


johnrambo
06-01-2010, 12:26 PM
I have looked for ideas on this and read several posts but none of them seems to be helpful because the problem is that web.com (my host) doesnt allow us to update web.config on their server programmatic. I can use example codes and encrypt them on my local pc but heres the error i get:

An error occurred loading a configuration file: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (machine.config)


Any ideas on this will be appreciated.

johnrambo
06-01-2010, 02:26 PM
I want to encrypt the connection string in teh web.config on a shared hosting such as web.config

Gozzy82
06-02-2010, 10:04 AM
why do you want to do this, everytime your page has to make a database connection the connectionstring will have to be decoded, seems like a big waste of resources.

anyway if you put your encoded string inside the web.config you can decode it using some class

so something like

string encrypted = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

string decrypted = encoderClass.doSomeFunkyStuff( encrypted );

make a connection with decrypted

like i said seems like a total waste waste of resources :)