Page 1 of 1

How to make a safety connection string?

Posted: Tue Dec 08, 2015 7:30 pm
by KraZy
Hi there,

for some reason I must develop an application in vb.net, now this application execute a connection with a database, for the moment I save the connectino details in the settings of App.config, so I've this structure:
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="Test_Sync.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
    <userSettings>
        <Test_Sync.My.MySettings>
            <setting name="server_name" serializeAs="String">
                <value />
            </setting>
            <setting name="username" serializeAs="String">
                <value />
            </setting>
            <setting name="password" serializeAs="String">
                <value />
            </setting>
            <setting name="database" serializeAs="String">
                <value />
            </setting>
            <setting name="state" serializeAs="String">
                <value>False</value>
            </setting>
        </Test_Sync.My.MySettings>
    </userSettings>
</configuration>
Now I want to know how I can encrypt this information, in particular (username, password, database, server_name). Someone could made a tutorial for this?

Re: How to make a safety connection string?

Posted: Wed Dec 09, 2015 9:50 am
by visualtech
Someone can, but then it'll be futile. You're doing something for the sake of doing it; it isn't the standard you should use when dealing with critical and/or private information. Consider rewiring the application. It can save you from hours of frustration and anger later. :) Should you need any help, I am only a PM away.

Re: How to make a safety connection string?

Posted: Wed Dec 09, 2015 11:55 am
by KraZy
visualtech wrote:
Someone can, but then it'll be futile. You're doing something for the sake of doing it; it isn't the standard you should use when dealing with critical and/or private information. Consider rewiring the application. It can save you from hours of frustration and anger later. :) Should you need any help, I am only a PM away.
I just want encrypt the connection string that's it.

Re: How to make a safety connection string?

Posted: Tue Dec 15, 2015 12:02 am
by MrGeneralQ
What you should do is using PHP to make The connection. Never put Your credentials in Your program , not even in the code itself

Re: How to make a safety connection string?

Posted: Tue Dec 15, 2015 9:25 am
by visualtech
MrGeneralQ, instead of providing futile solutions, let's just focus on the problem the OP has at hand. I told him about what you're saying right now, but, he doesn't want that. One thing you need to understand while making suggestions is the realm of the problem. You're suggesting PHP for a front-end NATIVE application. In the last post, you simply declined the usage of JSON in VB.NET.

The point I am trying to make here is that you should research a little bit before posting. No hard feelings! :)

Re: How to make a safety connection string?

Posted: Tue Dec 15, 2015 7:20 pm
by KraZy
I could accept also a backend php script that allow the connection but I never work on a similar thing

Re: How to make a safety connection string?

Posted: Sun Feb 28, 2016 12:42 pm
by MrGeneralQ
I just give the safest solution.
Saving server details serverside is NEVER a good idea.