Click here to Skip to main content
13,145,464 members (52,686 online)
Click here to Skip to main content


27 bookmarked
Posted 25 Aug 2006

Securing ADO.NET Connection Strings

, 25 Aug 2006
Some possible ways to encrypt and store connection strings in an ADO.NET application.
<?xml version="1.0" encoding="utf-8"?>
    <EncryptedData Type="" xmlns=""><EncryptionMethod Algorithm="" /><KeyInfo xmlns=""><EncryptedKey xmlns=""><EncryptionMethod Algorithm="" /><KeyInfo xmlns=""><KeyName>rsaKey</KeyName></KeyInfo><CipherData><CipherValue>JY1430lvVnubmiUwq6lYhSQgwFdVKGCHEL1/pQy7m9vmcnk8+XNGqgqC4ko5DZXWIoGZfSCvLC5BD24GgLPIhUiyRXSL8ONAJzUqsrK35Lwv1xfvytEGkidt+57LfOdfYs5Sl9jSTQpb+C1qaDIzpMbe9D6uzjKbjR6lYbSUJ/M=</CipherValue></CipherData></EncryptedKey></KeyInfo><CipherData><CipherValue>l+YoWvC6hahrlf0eb877tawyBzY2UkGKYm3qfSbGjUXb7ipqbTjcsOTljXzBYRltcvrJmQ/W2LpZzBLN0Ui4oTmSx+mfdZx24Ey3TJcvQgZR1yoCrGyq+XM6MQ4tMWRZ8WZhYE8znWOer4tbQvTolYyXK9QqiBAJkXhz1fGKLTMcOxAxnFEtODDkLz/4MvkdH3mWUa7I2/V49TCFp7Q/MioqCYHih+ANIHkLzZAkaXC1XMd7bJsDtM50eIb5e+C433E/oRyGix1R9Asusz5BZAhyH/An1qmZpgzvK15+3FkmhEZmRNhtKe7dM1ic99F+kqd39KCZ4rG2CutxjoiW1Pzz4SPvulZixsT33diJQWoiDO8xU6CRKBB6h/9TzBdfwpYVaAWGNWw19Skci0gK9Nd+ZwGWZoNXmMpfz9HYJfU=</CipherValue></CipherData></EncryptedData>
            <!-- This section defines the logging configuration for My.Application.Log -->
            <source name="DefaultSource" switchName="DefaultSwitch">
                    <add name="FileLog" />
                    <!-- Uncomment the below section to write to the Application Event Log -->
                    <!--<add name="EventLog"/>-->
            <add name="DefaultSwitch" value="Information" />
            <add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter" />
            <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
            <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Levan Midodashvili
Web Developer
Georgia Georgia
Lecturer in Gori University (Georgia)

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170915.1 | Last Updated 25 Aug 2006
Article Copyright 2006 by Levan Midodashvili
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid