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 can I hide my Api key?
QtWS25 Last Chance

How can I hide my Api key?

Scheduled Pinned Locked Moved Solved General and Desktop
qt creatorfirebaseapiqt6
5 Posts 4 Posters 874 Views
  • 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.
  • H Offline
    H Offline
    HeerokNewbie
    wrote on 24 Jan 2022, 13:28 last edited by
    #1

    I have created an online software which stores user's files in online storage of firebase. And now I want to upload that project to GitHub.But my API keys are in the files of that project. And I have read in some articles that it is not safe to share API key on GitHub. Hackers can misuse your entire database using API keys. So my question is, is there any way by which I can hide my API key inside the file itself.Sounds impossible, but how do I upload my project to GitHub so that my API key is not stolen? Please help me and thanks in advance.

    J 1 Reply Last reply 24 Jan 2022, 13:35
    0
    • H HeerokNewbie
      24 Jan 2022, 13:28

      I have created an online software which stores user's files in online storage of firebase. And now I want to upload that project to GitHub.But my API keys are in the files of that project. And I have read in some articles that it is not safe to share API key on GitHub. Hackers can misuse your entire database using API keys. So my question is, is there any way by which I can hide my API key inside the file itself.Sounds impossible, but how do I upload my project to GitHub so that my API key is not stolen? Please help me and thanks in advance.

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 24 Jan 2022, 13:35 last edited by JKSH
      #2

      @HeerokNewbie said in How can I hide my Api key?:

      I have read in some articles that it is not safe to share API key on GitHub. Hackers can misuse your entire database using API keys.

      Yes, that is true for most API keys that give you access permissions.

      I have created an online software which stores user's files in online storage of firebase. And now I want to upload that project to GitHub.But my API keys are in the files of that project.

      Firebase API keys are different; they don't provide permissions so hackers can't use your key to modify your Firebase database.

      However, you should still set up restrictions on your key. See https://firebase.google.com/docs/projects/api-keys

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      3
      • H Offline
        H Offline
        HeerokNewbie
        wrote on 24 Jan 2022, 13:51 last edited by
        #3

        @JKSH So can I upload my project to GitHub without worrying? I have restricted my firebase storage rules. Is this enough or do I have to restrict my API key as well?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 24 Jan 2022, 20:42 last edited by
          #4

          Hi,

          Usually API keys are stored offline and provided as secret at build/deploy time.
          Or if user specific, you would have them create an account somewhere and have them enter the key in your software.

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

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Kent-Dorfman
            wrote on 24 Jan 2022, 21:31 last edited by
            #5

            ever hear of macro guarded code inclusion and .gitignore?

            1 Reply Last reply
            0

            2/5

            24 Jan 2022, 13:35

            • Login

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