According to others, obfuscation is not real protection for the connection string stored in the client application, where the user has access to binary files.
Do not use a direct connection to the database from your program if the user is not trusted to use the database directly with the same privileges. Have a service (web service, REST service, etc.) Meanwhile, what you host on your own server. Linux can host services of any of the types I talked about (use Mono if you want them in .NET on Linux)
To expose your database through a web service using Mono or any other language / framework that you can host on Linux, you would create a website maintenance method for every atomic operation you want to perform against the database.
An additional advantage of allowing the client application to directly access the database is that when the client application uses the service between itself and the database, you can change the data store without affecting the client. You can change the database schema in your database or replace the database with a NOSQL solution or even a flat file.
Having a service instead of a direct connection to the database moves the authentication / authorization requirement one step, so now you need to implement it in the service. Fortunately, the web service has rich authentication support.
source share