Encrypting connectionstring or any section in web.config (Codesmith, Nettiers)

We are using NetTiers templates with Codesmith tool to generate the code base for our database. The autogenerated code base uses the SQL connection string in clear text format. We realized that it is a showstopper only after our deployment team pointed it out.  To our surprise we were able to find a quick solution [...]