Reputation: 1
I have made a Java application using Swing. I use a total of 12 classes, 10 forms and one main class. All are packed in a jar with all the necessary libraries and resources. The jar is an executable and is working fine with no issues.
The problem is that it is a database related distributed application.
I have used many Connection
objects to connect with mysql.
The connection is public. If a hacker or attacker imports my jar to his own project
and try to get the clone of that connection will he be able to hack the database?
If yes, what is the solution and if no, why can't he?
Upvotes: 0
Views: 230
Reputation: 166
It depends on what exactly is in the jar and how you are connecting to the database.
A jar file that just has class-files in it, can be reverse engineered rather easily. This would let a hacker see a great deal of what you have coded, especially things like URL and SQL strings. You can try to be really clever and build up the strings, but you would probably have to be twice as clever as the hacker to be able to hide things from him.
So, instead of trying to make the jar hack-proof, protect your database. The public connection should not have very many privileges, and the admin account should not be accessible remotely for the most security. There are likely more things one should do to secure your database, but I am not a DBA.
Good luck.
Upvotes: 3