Before encrypting connection strings, think about what you are trying to protect by encrypting them. Your application will need access to the plaintext connection string in order, and therefore access to the key will be required. Thus, an attacker who compromises your ASP.Net application is most likely able to steal a key and a secure connection string. Therefore, encryption does not really bring much benefit.
Instead of encryption, focus on how this file is handled by operations personnel and file permissions that are used in production. Allow read-only access to the ASP.Net work pool account in which your application runs.
source share