Some Encryption/Decryption Questions

I am using Microsoft Pro Sync Franework to synchronize a SQL Server CE 3.5 database with SQL Server 2008 R2 Express. I have a few question:

I know how to encrypt the connection string in app.config. How do I decrypt it on the server side so it is not transmitted in plain text?

The database is relatively small. How would I programmatically encrypt the entire db on both computers and then maintain synchronization? It would not work well if the encryption depended on the user/machine combination. I would need to use a machine independent method.
LVL 1
rkulpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sr75Commented:
You should force SSL connections on the SQL server and use that instead.
0
sr75Commented:
Here is how to configure the SQL server
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rkulpAuthor Commented:
Thanks for your quick post.
Unfortunately I have a SSL certificate from a trusted CA that won't work because the SQL Server Express server is behind a router using port forwarding. Hence, I can't use aliasing. I'll look into a self-signed certificate and force the trust.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rkulpAuthor Commented:
The link you provided did help me. I was able to find the thumbprint (although Firefox calls it a fingerprint) and put that in the registry. The service has started up again. It may take a bit of testing to get definitive results that the SSL is working properly, but it should work when the connection string is changed from http:// to https://.
0
rkulpAuthor Commented:
I appreicate your help.
0
sr75Commented:
Glad to have helped you get it working.
0
rkulpAuthor Commented:
Here is what I had to do for the connection string:
        Dim builder As New System.Data.SqlClient.SqlConnectionStringBuilder
        With builder
            .DataSource = Trim(txtServer.Text)
            .UserID = Trim(txtLoginName.Text)
            .Password = Trim(txtPassword.Text)
            .IntegratedSecurity = False
            .PersistSecurityInfo = True
            .InitialCatalog = "HouseholdInventory"
            .Encrypt = True
            .TrustServerCertificate = True
        End With

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.