Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to obfuscate my code.
Forum Updated to NodeBB v4.3 + New Features

How to obfuscate my code.

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 5 Posters 1.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    InferusAnima
    wrote on 6 Apr 2020, 13:13 last edited by
    #1

    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?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Apr 2020, 13:25 last edited by SGaist 4 Jun 2020, 13:25
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply 6 Apr 2020, 13:50
      1
      • S SGaist
        6 Apr 2020, 13:25

        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.

        I Offline
        I Offline
        InferusAnima
        wrote on 6 Apr 2020, 13:50 last edited by
        #3

        @SGaist It's database with logins and passes. I can't give access to it to users.

        W 1 Reply Last reply 6 Apr 2020, 23:34
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 6 Apr 2020, 18:10 last edited by
          #4

          Where is that database supposed to be located ?
          What is it used for ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply 6 Apr 2020, 19:49
          0
          • S SGaist
            6 Apr 2020, 18:10

            Where is that database supposed to be located ?
            What is it used for ?

            I Offline
            I Offline
            InferusAnima
            wrote on 6 Apr 2020, 19:49 last edited by
            #5

            @SGaist On remote mysql server, i need to obfuscate servername, username, dbaname, and pass. For logins and passwords of users.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 6 Apr 2020, 19:52 last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              I 1 Reply Last reply 6 Apr 2020, 20:41
              1
              • S SGaist
                6 Apr 2020, 19:52

                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.

                I Offline
                I Offline
                InferusAnima
                wrote on 6 Apr 2020, 20:41 last edited by
                #7

                @SGaist It's harder then just obfucate code. So i can't do that?

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  fcarney
                  wrote on 6 Apr 2020, 21:05 last edited by
                  #8

                  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.

                  C++ is a perfectly valid school of magic.

                  1 Reply Last reply
                  2
                  • I InferusAnima
                    6 Apr 2020, 13:50

                    @SGaist It's database with logins and passes. I can't give access to it to users.

                    W Offline
                    W Offline
                    wrosecrans
                    wrote on 6 Apr 2020, 23:34 last edited by
                    #9

                    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.

                    1 Reply Last reply
                    3
                    • S Offline
                      S Offline
                      SimonSchroeder
                      wrote on 7 Apr 2020, 06:19 last edited by
                      #10

                      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.

                      1 Reply Last reply
                      0

                      1/10

                      6 Apr 2020, 13:13

                      • Login

                      • Login or register to search.
                      1 out of 10
                      • First post
                        1/10
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved