none
How to securely store a connection string in a WinForms application in app.config? RRS feed

  • Question

  • Hello Everybody

    I need to know what is the common way to store a SQL server connection string for a WinForms application in VB.NET

    my Config Value is:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="EncryptCn.My.MySettings.databaseConnectionString"  connectionString="Data Source=192.168.0.1;Initial Catalog=PersonData;User ID=SA;Password=12345678"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
        <system.diagnostics>
            <sources>
                <!-- This section defines the logging configuration for My.Application.Log -->
                <source name="DefaultSource" switchName="DefaultSwitch">
                    <listeners>
                        <add name="FileLog"/>
                        <!-- Uncomment the below section to write to the Application Event Log -->
                        <!--<add name="EventLog"/>-->
                    </listeners>
                </source>
            </sources>
            <switches>
                <add name="DefaultSwitch" value="Information" />
            </switches>
            <sharedListeners>
                <add name="FileLog"
                     type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, 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"/> -->
            </sharedListeners>
        </system.diagnostics>
    </configuration>
    
    thanks all


    Name of Allah, Most Gracious, Most Merciful and He created the human

    Friday, July 21, 2017 8:19 AM

Answers

  • In the following code you need to run the application once before deploying to encrypt the connection string. Now when the customer runs the application the connection string is decrypted, the connection string is read then the connection string is encrypted again.

    I tested this against a SQL-Server table where the connection string was generated by Visual Studio.

    Before encrypted

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="WindowsApplication1.My.MySettings.ForumExamplesConnectionString"
                connectionString="Data Source=KARENS-PC;Initial Catalog=ForumExamples;Integrated Security=True"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
        </startup>
    </configuration>

    Afterwards

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
            <EncryptedData>
                <CipherData>
                    <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA58Whgc2uk0yRC51pFIK/ZQQAAAACAAAAAAAQZgAAAAEAACAAAABWvu5W4iOezdgkTr5i71O9ZBAeZF4wgEOwYpd46Sd/AwAAAAAOgAAAAAIAACAAAAAeC9fob+3VxEuCWW5dI4qbDQGCwpkURb6RAx2XAFveWRACAABXlFrAH4NaoESGRzgbZZOeLsTNkHXF4R7o1sObnKMrMEfAcqKFxosJMz+8zcz0V6yiexvotsXRdJmNG2TzA1VZarjJUpXVkuma89DLQIF0YyzG3HKuZykxNyxgh0SAopruZ02shpfAs0mSplsJrqVSpRnfeR1gZeokzOjSs8CztOpuH/STo5o3gMhinCZVC0M4osve+1JrqvunVb7wy/+IjEPukFtk76qF+TuAjK18UIV4zdzkn1d5lokhpzb+2WPZxc+kNKukRmT/QR2Kv5bZ7bPD1I0zk4uQAg1NWYjLeLXljAhHOaCGJc+bpeh2lkaP2vfMTZ9VoHWcKBI/byleNxRpi1IZ2izaFnbjCS9e5e4YheSJCZfiJFXrZSyyOIaNeF3j36h/zjtYfkRUX/gOydXvT6N3V9XGZ4w6LkxUr5O4VLRouhbc0a+OlFVyBI2GkiOmyAP5Zho+1Id9mVqHKmTcDuuWVm1VjBBj+XAZgMWsilEKnazd62V8Ppocv83V7VEbxCbGBkGRvsZ/wQRMrAjyhHm3Wf23IMUhJ+YDnbeYDDt0BRjZQoDANpsnIq/ol55d8qzB9sGFTP5OQDaRiyGjAF+a6M4RtPvHSlSN5rBszok2AO+g2K0YPYEWnGBWZ4NaVpYoEh2JHEiEaRWJ41YZW+FRxOXmyq+/XgX+8eCbLZbDF09LMQ8UfX2mRChAAAAA+AkMWPZBFlIYRvugW0GsofcvOrn+MBvIytt0r6J6GtZXB68BXCWY1OcvnZ114X5m/WOfKvlDM0my1mgo4uD/Ww==</CipherValue>
                </CipherData>
            </EncryptedData>
        </connectionStrings>
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
        </startup>
    </configuration>

    Class used

    Imports System.Configuration
    Imports System.IO
    Public Class ConnectionProtection
        Public Property FileName As String
        Public Sub New(ByVal ExecutableFileName As String)
            FileName = ExecutableFileName
        End Sub
        Private Function EncryptConnectionString(ByVal encrypt As Boolean, ByVal fileName As String) As Boolean
            Dim success As Boolean = True
            Dim configuration As Configuration = Nothing
            Try
                configuration = ConfigurationManager.OpenExeConfiguration(fileName)
                Dim configSection As ConnectionStringsSection = TryCast(configuration.GetSection("connectionStrings"), ConnectionStringsSection)
                If (Not (configSection.ElementInformation.IsLocked)) AndAlso (Not (configSection.SectionInformation.IsLocked)) Then
                    If encrypt AndAlso (Not configSection.SectionInformation.IsProtected) Then
                        'this line will encrypt the file
                        configSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider")
                    End If
    
                    If (Not encrypt) AndAlso configSection.SectionInformation.IsProtected Then 'encrypt is true so encrypt
                        'this line will decrypt the file. 
                        configSection.SectionInformation.UnprotectSection()
                    End If
                    're-save the configuration file section
                    configSection.SectionInformation.ForceSave = True
                    ' Save the current configuration
    
                    configuration.Save()
                    success = True
                End If
            Catch ex As Exception
                success = False
            End Try
    
            Return success
        End Function
        Public Function EncryptFile() As Boolean
            If File.Exists(FileName) Then
                Return EncryptConnectionString(True, FileName)
            Else
                Return False
            End If
        End Function
        Public Function DecryptFile() As Boolean
            If File.Exists(FileName) Then
                Return EncryptConnectionString(False, FileName)
            Else
                Return False
            End If
        End Function
    
    End Class
    

    Form code

    Public Class Form1
        Private operations As New ConnectionProtection(Application.ExecutablePath)
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            operations.EncryptFile()
            operations.DecryptFile()
            'TODO: This line of code loads data into the 'ForumExamplesDataSet.Departments' table. You can move, or remove it, as needed.
            Me.DepartmentsTableAdapter.Fill(Me.ForumExamplesDataSet.Departments)
            operations.EncryptFile()
        End Sub
        Private Sub DepartmentsBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles DepartmentsBindingNavigatorSaveItem.Click
            Me.Validate()
            Me.DepartmentsBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.ForumExamplesDataSet)
        End Sub
    End Class
    


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by sh 2020 Wednesday, July 26, 2017 3:17 PM
    Friday, July 21, 2017 9:24 AM
    Moderator
  • Add the following reference to the project.

    Add an Import statement in ConnectionProtection For System.Configuration.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Proposed as answer by Frank L. Smith Sunday, July 23, 2017 12:19 AM
    • Marked as answer by sh 2020 Wednesday, July 26, 2017 3:17 PM
    Saturday, July 22, 2017 10:50 PM
    Moderator

All replies

  • In the following code you need to run the application once before deploying to encrypt the connection string. Now when the customer runs the application the connection string is decrypted, the connection string is read then the connection string is encrypted again.

    I tested this against a SQL-Server table where the connection string was generated by Visual Studio.

    Before encrypted

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="WindowsApplication1.My.MySettings.ForumExamplesConnectionString"
                connectionString="Data Source=KARENS-PC;Initial Catalog=ForumExamples;Integrated Security=True"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
        </startup>
    </configuration>

    Afterwards

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
            <EncryptedData>
                <CipherData>
                    <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA58Whgc2uk0yRC51pFIK/ZQQAAAACAAAAAAAQZgAAAAEAACAAAABWvu5W4iOezdgkTr5i71O9ZBAeZF4wgEOwYpd46Sd/AwAAAAAOgAAAAAIAACAAAAAeC9fob+3VxEuCWW5dI4qbDQGCwpkURb6RAx2XAFveWRACAABXlFrAH4NaoESGRzgbZZOeLsTNkHXF4R7o1sObnKMrMEfAcqKFxosJMz+8zcz0V6yiexvotsXRdJmNG2TzA1VZarjJUpXVkuma89DLQIF0YyzG3HKuZykxNyxgh0SAopruZ02shpfAs0mSplsJrqVSpRnfeR1gZeokzOjSs8CztOpuH/STo5o3gMhinCZVC0M4osve+1JrqvunVb7wy/+IjEPukFtk76qF+TuAjK18UIV4zdzkn1d5lokhpzb+2WPZxc+kNKukRmT/QR2Kv5bZ7bPD1I0zk4uQAg1NWYjLeLXljAhHOaCGJc+bpeh2lkaP2vfMTZ9VoHWcKBI/byleNxRpi1IZ2izaFnbjCS9e5e4YheSJCZfiJFXrZSyyOIaNeF3j36h/zjtYfkRUX/gOydXvT6N3V9XGZ4w6LkxUr5O4VLRouhbc0a+OlFVyBI2GkiOmyAP5Zho+1Id9mVqHKmTcDuuWVm1VjBBj+XAZgMWsilEKnazd62V8Ppocv83V7VEbxCbGBkGRvsZ/wQRMrAjyhHm3Wf23IMUhJ+YDnbeYDDt0BRjZQoDANpsnIq/ol55d8qzB9sGFTP5OQDaRiyGjAF+a6M4RtPvHSlSN5rBszok2AO+g2K0YPYEWnGBWZ4NaVpYoEh2JHEiEaRWJ41YZW+FRxOXmyq+/XgX+8eCbLZbDF09LMQ8UfX2mRChAAAAA+AkMWPZBFlIYRvugW0GsofcvOrn+MBvIytt0r6J6GtZXB68BXCWY1OcvnZ114X5m/WOfKvlDM0my1mgo4uD/Ww==</CipherValue>
                </CipherData>
            </EncryptedData>
        </connectionStrings>
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
        </startup>
    </configuration>

    Class used

    Imports System.Configuration
    Imports System.IO
    Public Class ConnectionProtection
        Public Property FileName As String
        Public Sub New(ByVal ExecutableFileName As String)
            FileName = ExecutableFileName
        End Sub
        Private Function EncryptConnectionString(ByVal encrypt As Boolean, ByVal fileName As String) As Boolean
            Dim success As Boolean = True
            Dim configuration As Configuration = Nothing
            Try
                configuration = ConfigurationManager.OpenExeConfiguration(fileName)
                Dim configSection As ConnectionStringsSection = TryCast(configuration.GetSection("connectionStrings"), ConnectionStringsSection)
                If (Not (configSection.ElementInformation.IsLocked)) AndAlso (Not (configSection.SectionInformation.IsLocked)) Then
                    If encrypt AndAlso (Not configSection.SectionInformation.IsProtected) Then
                        'this line will encrypt the file
                        configSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider")
                    End If
    
                    If (Not encrypt) AndAlso configSection.SectionInformation.IsProtected Then 'encrypt is true so encrypt
                        'this line will decrypt the file. 
                        configSection.SectionInformation.UnprotectSection()
                    End If
                    're-save the configuration file section
                    configSection.SectionInformation.ForceSave = True
                    ' Save the current configuration
    
                    configuration.Save()
                    success = True
                End If
            Catch ex As Exception
                success = False
            End Try
    
            Return success
        End Function
        Public Function EncryptFile() As Boolean
            If File.Exists(FileName) Then
                Return EncryptConnectionString(True, FileName)
            Else
                Return False
            End If
        End Function
        Public Function DecryptFile() As Boolean
            If File.Exists(FileName) Then
                Return EncryptConnectionString(False, FileName)
            Else
                Return False
            End If
        End Function
    
    End Class
    

    Form code

    Public Class Form1
        Private operations As New ConnectionProtection(Application.ExecutablePath)
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            operations.EncryptFile()
            operations.DecryptFile()
            'TODO: This line of code loads data into the 'ForumExamplesDataSet.Departments' table. You can move, or remove it, as needed.
            Me.DepartmentsTableAdapter.Fill(Me.ForumExamplesDataSet.Departments)
            operations.EncryptFile()
        End Sub
        Private Sub DepartmentsBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles DepartmentsBindingNavigatorSaveItem.Click
            Me.Validate()
            Me.DepartmentsBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.ForumExamplesDataSet)
        End Sub
    End Class
    


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by sh 2020 Wednesday, July 26, 2017 3:17 PM
    Friday, July 21, 2017 9:24 AM
    Moderator
  • In the following code you need to run the application once before deploying to encrypt the connection string. Now when the customer runs the application the connection string is decrypted, the connection string is read then the connection string is encrypted again.

    I tested this against a SQL-Server table where the connection string was generated by Visual Studio.

    Before encrypted

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="WindowsApplication1.My.MySettings.ForumExamplesConnectionString"
                connectionString="Data Source=KARENS-PC;Initial Catalog=ForumExamples;Integrated Security=True"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
        </startup>
    </configuration>

    Afterwards

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
            <EncryptedData>
                <CipherData>
                    <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA58Whgc2uk0yRC51pFIK/ZQQAAAACAAAAAAAQZgAAAAEAACAAAABWvu5W4iOezdgkTr5i71O9ZBAeZF4wgEOwYpd46Sd/AwAAAAAOgAAAAAIAACAAAAAeC9fob+3VxEuCWW5dI4qbDQGCwpkURb6RAx2XAFveWRACAABXlFrAH4NaoESGRzgbZZOeLsTNkHXF4R7o1sObnKMrMEfAcqKFxosJMz+8zcz0V6yiexvotsXRdJmNG2TzA1VZarjJUpXVkuma89DLQIF0YyzG3HKuZykxNyxgh0SAopruZ02shpfAs0mSplsJrqVSpRnfeR1gZeokzOjSs8CztOpuH/STo5o3gMhinCZVC0M4osve+1JrqvunVb7wy/+IjEPukFtk76qF+TuAjK18UIV4zdzkn1d5lokhpzb+2WPZxc+kNKukRmT/QR2Kv5bZ7bPD1I0zk4uQAg1NWYjLeLXljAhHOaCGJc+bpeh2lkaP2vfMTZ9VoHWcKBI/byleNxRpi1IZ2izaFnbjCS9e5e4YheSJCZfiJFXrZSyyOIaNeF3j36h/zjtYfkRUX/gOydXvT6N3V9XGZ4w6LkxUr5O4VLRouhbc0a+OlFVyBI2GkiOmyAP5Zho+1Id9mVqHKmTcDuuWVm1VjBBj+XAZgMWsilEKnazd62V8Ppocv83V7VEbxCbGBkGRvsZ/wQRMrAjyhHm3Wf23IMUhJ+YDnbeYDDt0BRjZQoDANpsnIq/ol55d8qzB9sGFTP5OQDaRiyGjAF+a6M4RtPvHSlSN5rBszok2AO+g2K0YPYEWnGBWZ4NaVpYoEh2JHEiEaRWJ41YZW+FRxOXmyq+/XgX+8eCbLZbDF09LMQ8UfX2mRChAAAAA+AkMWPZBFlIYRvugW0GsofcvOrn+MBvIytt0r6J6GtZXB68BXCWY1OcvnZ114X5m/WOfKvlDM0my1mgo4uD/Ww==</CipherValue>
                </CipherData>
            </EncryptedData>
        </connectionStrings>
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
        </startup>
    </configuration>

    Class used

    Imports System.Configuration
    Imports System.IO
    Public Class ConnectionProtection
        Public Property FileName As String
        Public Sub New(ByVal ExecutableFileName As String)
            FileName = ExecutableFileName
        End Sub
        Private Function EncryptConnectionString(ByVal encrypt As Boolean, ByVal fileName As String) As Boolean
            Dim success As Boolean = True
            Dim configuration As Configuration = Nothing
            Try
                configuration = ConfigurationManager.OpenExeConfiguration(fileName)
                Dim configSection As ConnectionStringsSection = TryCast(configuration.GetSection("connectionStrings"), ConnectionStringsSection)
                If (Not (configSection.ElementInformation.IsLocked)) AndAlso (Not (configSection.SectionInformation.IsLocked)) Then
                    If encrypt AndAlso (Not configSection.SectionInformation.IsProtected) Then
                        'this line will encrypt the file
                        configSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider")
                    End If
    
                    If (Not encrypt) AndAlso configSection.SectionInformation.IsProtected Then 'encrypt is true so encrypt
                        'this line will decrypt the file. 
                        configSection.SectionInformation.UnprotectSection()
                    End If
                    're-save the configuration file section
                    configSection.SectionInformation.ForceSave = True
                    ' Save the current configuration
    
                    configuration.Save()
                    success = True
                End If
            Catch ex As Exception
                success = False
            End Try
    
            Return success
        End Function
        Public Function EncryptFile() As Boolean
            If File.Exists(FileName) Then
                Return EncryptConnectionString(True, FileName)
            Else
                Return False
            End If
        End Function
        Public Function DecryptFile() As Boolean
            If File.Exists(FileName) Then
                Return EncryptConnectionString(False, FileName)
            Else
                Return False
            End If
        End Function
    
    End Class

    Form code

    Public Class Form1
        Private operations As New ConnectionProtection(Application.ExecutablePath)
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            operations.EncryptFile()
            operations.DecryptFile()
            'TODO: This line of code loads data into the 'ForumExamplesDataSet.Departments' table. You can move, or remove it, as needed.
            Me.DepartmentsTableAdapter.Fill(Me.ForumExamplesDataSet.Departments)
            operations.EncryptFile()
        End Sub
        Private Sub DepartmentsBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles DepartmentsBindingNavigatorSaveItem.Click
            Me.Validate()
            Me.DepartmentsBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.ForumExamplesDataSet)
        End Sub
    End Class


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    thanks dear

    i do it but i see this error...

    Severity	Code	Description	Project	File	Line	Suppression State
    Error	BC30451	'ConfigurationManager' is not declared. It may be inaccessible due to its protection level.	EncryptCn	

    how to solve it?


    Name of Allah, Most Gracious, Most Merciful and He created the human

    Saturday, July 22, 2017 3:18 PM
  • Add the following reference to the project.

    Add an Import statement in ConnectionProtection For System.Configuration.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Proposed as answer by Frank L. Smith Sunday, July 23, 2017 12:19 AM
    • Marked as answer by sh 2020 Wednesday, July 26, 2017 3:17 PM
    Saturday, July 22, 2017 10:50 PM
    Moderator
  • Add the following reference to the project.

    Add an Import statement in ConnectionProtection For System.Configuration.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thanks Dear ;-)

    Name of Allah, Most Gracious, Most Merciful and He created the human

    Wednesday, July 26, 2017 3:18 PM
  • What happens if the .exe is on a network share where 50+ people are using the same .exe.  Won't it cause problems if multiple instances are trying to encrypt/decrypt the same file?
    Friday, June 7, 2019 7:58 PM
  • Is there a way just to read in the encrypted config file & then decrypt it in memory to get the connection string? That way in the example above, multiple instances of the same app wouldn't be encrypting & decrypting (reading/writing) to/from the same file. I understand that I would have to make sure to encrypt the config file before deploying, but connectionString information doesn't change very often so would be acceptable to me.
    Friday, June 7, 2019 8:27 PM
  • What happens if the .exe is on a network share where 50+ people are using the same .exe.  Won't it cause problems if multiple instances are trying to encrypt/decrypt the same file?
    Why would you think that? Each user instance of the app are independent and cause no issues.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, June 7, 2019 8:37 PM
    Moderator