DEV Community

Discussion on: Protecting API keys in Flutter

Collapse
 
exadra37 profile image
Paulo Renato • Edited

It is always a fear that one day you might end up leaking your API key in a public git repository.

Thanks for writing down how developers can avoid this common pitfall :)

Now I would like to recommend you to read my answer in StackOverflow to the question How to protect Flutter app from reverse engineering to understand the other threats involved with using an API key in a mobile app.

My answer is split in sections:

  • How easy can it be to extract an API key from a Mobile APP?
  • Defending against Reverse Engineering
  • The Difference Between WHO and WHAT is Accessing the API Server
  • Lockdown the API server to the Mobile App

Found one more answer I gave in StackOverflow to a question with the title Securely Saving API Keys In Android (flutter) Apps, that is also split in sections:

  • How Hard Can It Be To Extract An Api Key?
    • Extract The Api Key With Static Binary Analysis
    • Extract The Api Key With A Mitm Attack
    • Extract With Instrumentation Framework
  • Storing Api Keys Encrypted In The Mobile App?
  • Firebase And Safetynet For The Rescue?
  • Proxy Or Backend Server
  • Possible Better Solution

Feel free to ask here questions about any doubt you may have after reading it.