Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 925807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:34:43+00:00 2026-05-15T19:34:43+00:00

I just realized that there is no best way to hide MySQL string connection

  • 0

I just realized that there is no best way to hide MySQL string connection password in my executable file, especially in JAR file. Even encrypting it in EXE would only slow down the process (although I’m not sure how much time would it take to get an encrypted password from an EXE file).

So, from my understanding, I need something in the middle that would do the add, edit, delete etc to the database. Seems like a job for REST API or maybe SOAP services.

My question is, which one should I use? Or should I use something else? I was thinking Zend Framework to create those REST APIs. Then, I would use Qt to create a desktop application to call those APIs. But if I proceed with REST, my application would be a 3 tier application. Wouldn’t it be better if I just create a web application? Maybe I should just stick to desktop application call those APIs since the application is already finished and I just need to change from connecting directly to MySQL to calling those APIs to perform tasks rather than changing the whole application to a web.

Any advice would be very helpful. Thanks in advance.

UPDATE:

I’m looking for a security that would protect my MySQL password connection.

Obfuscator would only obfuscate the code, it won’t hide my string database information which In my opinion can be easily found using grep after decompiling the JAR using tools like JAD.

About my application:

  1. Using a centralized MySQL database
  2. Thousands of user
  3. Contains sensitive information
  4. My client uses Linux and Windows
  5. My server uses Linux
  6. All access are done in LAN, no outside connection (from Internet etc)

My current solutions (comments please):

  1. Using REST APIs (safer since MySQL password is in the server)
  2. Using Qt with encryption to the password
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:34:43+00:00Added an answer on May 15, 2026 at 7:34 pm

    It depends on what kind of security are you looking for. Is this to protect the application from the user? To protect the user’s data from other users? To protect multiple users’ data from one another? To protect the user’s data from an attacker?

    In a lot of applications there’s nothing wrong with storing the database login credentials in plain text. In other cases, you might try:

    1. encrypting a user-chosen database password using a reasonably strong algorithm, e.g. Blowfish, using a hard-coded key;
    2. having the user provide the password and “log in” to the program each time;
    3. storing the database password in plain-text, but encrypt the data using a hard-coded key;
    4. same as the above, but encrypt each user’s data using their own provided password;
    5. same as 2 but store each user’s data in their own database with their login info as the database credentials;
    6. storing the data on a secure remote database that users have to log into to access via a SOAP API;
    7. using the native filesystem permissions to protect the configuration file holding the login credentials;
    8. same as #1 but rolling your own really elaborate key-generation system: e.g. run the machine SID or a hardware id through MD5 using a randomly-generated salt, and then using the result to encrypt the login credentials.

    Remember, there’s no such thing as perfect security, so whatever you settle on doesn’t need to be unbreakable. It just needs to be tough enough to break to make the hassle of circumventing the security mechanism exceed the value of the data. So, for example, if the data is a list of the top scores in Minesweeper, then ROT13 would probably be enough.

    Edit:
    I just want to add that, even if you can’t get around having to hard-code an encryption key in your application, there are obfuscators for Java, .NET, and most other popular languages/frameworks. One of the key uses of these tools is to hide sensitive hard-coded strings like encryption keys.

    Edit 2:
    Given the additional details about the app in question, only 1, 6 and 8 would apply in this case. And a SOAP API is more appropriate for #6 as George rightly pointed out.

    I also want to mention that there are Java resource obfuscators that encrypt string literals. This is just one example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There doesn't seem to be any tried and true set of best practices to
(please excuse that I didn't use aliases). I would like my query output to
I have a new web app that is packaged as a WAR as part
I'm working on a project in C# w/ XNA, and I want to reorganize
I am playing with TFS 2010, and am trying to setup a build process
My question is about memory use and objects in actionscript 2. If I have
I am using a 3rd-party rotator object, which is providing a smooth, random rotation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.