This guide shows how to encrypt whole connection string in web.config in an IIS website.
https://blog.elmah.io/the-ultimate-guide-to-connection-strings-in-web-config/
In short, run this command inside command prompt as administrator
aspnet_regiis -pef "connectionStrings" "c:\path\to\the\folder\containing\webconfig"