Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to obfuscate my code.
I have Qt GUI project and when i built it, i found with hex editor that there is my MySql connection data.
How can i protect and obfuscate my code?
Hi and welcome to devnet,
The best way is to not have that data in your binary at all. It's typically something your user should fill settings for.
@SGaist It's database with logins and passes. I can't give access to it to users.
Where is that database supposed to be located ?
What is it used for ?
@SGaist On remote mysql server, i need to obfuscate servername, username, dbaname, and pass. For logins and passwords of users.
It sounds like you should rather provide a web service to access the data behind the database rather than hard coding all these informations in your application.
@SGaist It's harder then just obfucate code. So i can't do that?
fcarney last edited by
It doesn't matter if you obfuscate the code. The solution to de-obfuscate is in the code itself. So someone can still figure out how to get your database password and info. They can just look at the memory of the app to see this data. Also, if you ever change passwords the code breaks for the users who need to get the updated app.
wrosecrans last edited by
It's database with logins and passes. I can't give access to it to users.
@InferusAnima If you can't give it to users, then You Can't Give It To Users.
Giving them a program with the credentials baked in is fundamentally the wrong solution to that category of problem, no matter how much you try to obfuscate it. Reverse engineering it is going to be pretty much trivial.
SimonSchroeder last edited by
One rather simple solution is to encrypt this data. Still, this means that you also need to provide the key for decryption along with it. So, anyone who wants to get to that data still will figure it out. Nevertheless, it is not that obvious anymore when looking at the hex dump of your executable.
Note that this approach only obfuscates, but does not prevent anybody looking at it.