2

I want to program a Java Applet that connects to my personal MySQL database.

Now my question is: Can somebody e.g. open the class-file(s) from the JAR and look for the password/string? (Of course I would exclude the source files when I generate the JAR.) So is it insecure to put the password (as a plain string) in the code?

If it is insecure, what would you suggest. Obfuscator? No direct connection (e.g. using PHP-scripts)? Other options?

1
  • And how will you secure the password the the PHP service? Commented Nov 25, 2010 at 10:33

1 Answer 1

2

It's in general a bad idea as anyone could as well just sniff the packets sent. You should write a small web service (simple php/asp page) that handles authentication through http get/post and only submits requests you permit (e.g. avoid someone sniffing the username/password and then drop the database or modify it).

Also let the user create his/her own account to submit. If you're talking about some proposed high score functionality, just submit the name, highscore and some kind of checksum (and maybe some token) but there's no 100% secure way to do it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.