How can we encrypt the connection string section in web.config file?
.net – Encrypting Connection String in web.config
asp.netencryptionnetweb.config
Related Topic
- C# – Deep cloning objects
- C# – How to escape braces (curly brackets) in a format string in .NET
- C# – How to enumerate an enum
- C# – How to create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office
- Jquery – How to format a Microsoft JSON date
- C# – How to get a consistent byte representation of strings in C# without manually specifying an encoding
- C# – Read connection string from web.config
Best Answer
Rahul, converting a string from ASCII to base64 string isn't an encryption, which is what your first link suggests. We can easily convert base64 to ASCII.
Using configsection.protectSection() with an RSA key is a proper encryption that is available for sections of the Web.config file.
Check this link: http://www.beansoftware.com/ASP.NET-Tutorials/Encrypting-Connection-String.aspx
Please note, that we can not encrypt Web.config file in a shared hosting environment where Trust level is set to medium trust.