Free packages available on the Microsoft website to help with software development day by day.
This package you can use to encrypt and decrypt your database connection string. We are using public key and private key. .
see more here on Nuget Microsoft