Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Clickonce encrypting connection strings question

Clickonce encrypting connection strings question

Scheduled Pinned Locked Moved Database
sysadmincsharpdatabasequestionsql-server
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    netizenk
    wrote on last edited by
    #1

    I have a Clickonce .NET 2.0 winforms application located on a network share within our company intranet. I'm trying avoid having to deal with other departmens in setting up an AD group, managing users etc. because it is too much of a hassle eventhough I would love to use the integrated windows security... As far as I can tell the only other solution is to create a SQL server user with appropriate permissions on the database my program is connecting to and have my program use that SQL server user account to access the database but if I do that the connection string will be just plain text anyone can read... unless it is encrypted. Placing the connection string within the code is not acceptable since with the .NET code it would be easily accessible using MSIL or Reflector. Placing the conneciton string within the app.config file and encrypting it (http://msdn.microsoft.com/en-us/library/89211k9b(VS.80).aspx[Securing Connection Strings]) seemed like a good idea but it turns out the connection string must be encrypted/decrypted by the computer that will be running the program (The connection string can only be decrypted on the computer on which it was encrypted.) so it looks like the connection string would have to sit unencrypted on the network share and than my program would encrypt it during installation... having an unencrypted conneciton string on a network share that must be available to eveyrone to read from in order to support the Clickonce deployment doesn't sound like a good idea to me... Anyway, does anyone know a good solution for this problem other than using integrated securtiy and having to deal with a 72 hour turnaround for any changes to the AD group? TIA

    S 1 Reply Last reply
    0
    • N netizenk

      I have a Clickonce .NET 2.0 winforms application located on a network share within our company intranet. I'm trying avoid having to deal with other departmens in setting up an AD group, managing users etc. because it is too much of a hassle eventhough I would love to use the integrated windows security... As far as I can tell the only other solution is to create a SQL server user with appropriate permissions on the database my program is connecting to and have my program use that SQL server user account to access the database but if I do that the connection string will be just plain text anyone can read... unless it is encrypted. Placing the connection string within the code is not acceptable since with the .NET code it would be easily accessible using MSIL or Reflector. Placing the conneciton string within the app.config file and encrypting it (http://msdn.microsoft.com/en-us/library/89211k9b(VS.80).aspx[Securing Connection Strings]) seemed like a good idea but it turns out the connection string must be encrypted/decrypted by the computer that will be running the program (The connection string can only be decrypted on the computer on which it was encrypted.) so it looks like the connection string would have to sit unencrypted on the network share and than my program would encrypt it during installation... having an unencrypted conneciton string on a network share that must be available to eveyrone to read from in order to support the Clickonce deployment doesn't sound like a good idea to me... Anyway, does anyone know a good solution for this problem other than using integrated securtiy and having to deal with a 72 hour turnaround for any changes to the AD group? TIA

      S Offline
      S Offline
      SimulationofSai
      wrote on last edited by
      #2

      It's not necessary that you use the connectionstring element in web.config. You can define your own element and encrypt it yourself using the .NET encryption classes. You could perhaps store the decryption key in a shared location.

      N 1 Reply Last reply
      0
      • S SimulationofSai

        It's not necessary that you use the connectionstring element in web.config. You can define your own element and encrypt it yourself using the .NET encryption classes. You could perhaps store the decryption key in a shared location.

        N Offline
        N Offline
        netizenk
        wrote on last edited by
        #3

        Hi there, Thanks for your reply but as I mentioned in the first sentence of my question I'm dealing with a winforms application deployed with Clickonce and app.config, not web.config file...

        S 1 Reply Last reply
        0
        • N netizenk

          Hi there, Thanks for your reply but as I mentioned in the first sentence of my question I'm dealing with a winforms application deployed with Clickonce and app.config, not web.config file...

          S Offline
          S Offline
          SimulationofSai
          wrote on last edited by
          #4

          My answer still applies. You can still encrypt the connection string in app.config using your own key. You just need to use a Public key cryptography algorithm.

          N 1 Reply Last reply
          0
          • S SimulationofSai

            My answer still applies. You can still encrypt the connection string in app.config using your own key. You just need to use a Public key cryptography algorithm.

            N Offline
            N Offline
            netizenk
            wrote on last edited by
            #5

            Thanks, I'll look into that option... any other ideas?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups