How to hide translator API key in android

I use yandex and google translate in my application and of course I have a unique API key, but anyone can steal it by decompiling my application. How can I hide this?

+4
source share
3 answers

If I were you, I would rent a server (possibly amazon) and create a database and insert our api key with a simple encrypted string (hash, etc.).

ID - Name - androidKey - key

1 - GoogleAPI - AJKBSASHUA9 - yourAPIKey
2 - YandexAPI - 5A6S5D6A53C - yourAPIKey
.
.
.

Then you can create a service that starts with your name android packageName;

http://example.com/API/getAPIKey/
?packageName="yourPackageName"
&androidKey="AJKBSASHUA9"

POST, .

+1

APK . - , .

  • , .
  • , .

, SHA1 [Release | Debug] , .

+1

, , 150- , , . , , .

The OWASP Mobile Security project has published its collection “Ten Mobile Risks” , of which the topics “Broken cryptography” and “Broken cryptography”, Lack of binary protections “are especially interesting in your case. Although even this link does not give you a simple“ how ”, I I think this can help you assess your situation.

+1
source

Source: https://habr.com/ru/post/1615368/


All Articles