Learn. Share. Repeat.

Why did I start the site…?

I started this site mainly as a place where I can put any gotchas and snafus I find along the way to better help the development community. I hope it helps as time goes on.

Questions? Comments?

If you have a question about a post then please leave a comment. I'll reply on the comment to keep all answers for everyone to see.
If you have a private technical inquiry unrelated to any posts, please direct it to jared.meredith@live.com.

Categories

Archives

Useful Links

Encrypt And Decrypt A Sitecore ConnectionStrings.Config File

Encrypting .Net application web.config files are easy enough. However Sitecore is NOT a fan of you messing with the web.config. This is even part of the reason the connection strings are stored out into a separate file in Sitecore. I’ll go through a quick method of taking care of doing it on the separate Sitecore file.

Ensure you have .Net framework installed where you are going to perform the encryption (my examples are 4.0, you can use 2.0 if need be)

!!!IMPORTANT!!! Make a backup of your Sitecore ConnectionStrings.config file

Create a folder on C: to hold your encrypt/decrypt batch files (example will be C:\decrypter) where the .Net framework exists

Open notepad and create a batch file (encrypt.bat), put the following in for your encryption statement and then save it to your folder you just created

Create a blank web.config (THIS IS YOUR WEB.CONFIG YOU MADE AND NOT THE SITECORE WEB.CONFIG!!!), put and wrap your Sitecore connection strings (from ConnectionStrings.config) inside and save it to the folder you created. it should look something like:

Once completed take the connectionStrings section of the web.config and replace your ConnectionStrings.config file with the encrypted connectionStrings section (run notepad in admin mode if your sitecore is in the web root).

Recycle the app pool to refresh. You should now be encrypted!

If this fails for you at some point then replace your Sitecore connectionStrings.config file with the backup you took at the start.

And yes, to decrypt (to update your strings) put your encrypted connectionstrings section in your web.config (THIS IS YOUR WEB.CONFIG YOU MADE AND NOT THE SITECORE WEB.CONFIG!!!) in the windows folder you made and run the decrypt.bat as an admin. You should get:

Again, I hope this helps someone. Questions and comments are always welcome! And for the sake of hoping I catch the skimmers here, DO NOT MODIFY THE SITECORE WEB.CONFIG. DO THIS ON THE CONNECTIONSTRINGS.CONFIG! You have been warned…