Reputation: 15251
Is there a way to connect to a remote instance of MySQL without exposing MySQL credentials by using Java decompiler ?
If a desktop application connects to a MySQL Server, should you assign a read only access to user to access it? Is this secure enough?
Upvotes: 1
Views: 941
Reputation: 80603
If you find yourself asking these questions then it is probably time to implement some delegated authorization. Instead of the user accessing MySQL directly from your desktop app, create a thin server layer with each user assigned a set of credentials to access. All access to the database will be mediated through this server, which will be responsible for securing the DB and ensuring only data relevant to each user is actually given to them.
Upvotes: 2
Reputation: 10098
if your concern is to avoid password decompilation you could obfuscate your app..
you can use a read-only credential in your app, but this wouldn't prevent de compilation (however, if de compiled the user won't be able to change any data, this would be one way).
you could, use a custom class loader to load a class from the network (this class would contain the credentials)
none of the above techniques will prevent a well experienced user from de compiling and getting their hands on the credentials.
Upvotes: 0