To encrypt the connection string, you have to use the 'aspnet_regiis' utility.Open visual studio command prompt and type in the following line (obviously you'll have to provide your website's path!)
aspnet_regiis -pef "connectionStrings" "fully-qualified-path-to-website-folder"The above command will encrypt the web.config file at the location provided by you.
Now what if you want to roll back and decrypt the connection ?
Well then just open visual studio command prompt again and fire in this command:
aspnet_regiis -pdf "connectionStrings" "fully-qualified-path-to-website-folder"Happy Coding!