Here I will explain how to encrypt and decrypt connection string in app.config file in windows or console application using c#.net, vb.net. we can do encryption and decryption for connection string using aspnet_regiis.exe command line tool in file system website.
Generally in all applications we will use connectionStrings section in web.config or app.config file to store database connection. The connectionStrings section contains sensitive information of database connections including username and password of database. Is it secured to store the sensitive information of database connections in plain text files called web.config and machine.config files?