C
C
Chesterfield252021-12-05 00:16:54
Java
Chesterfield25, 2021-12-05 00:16:54

How to hide the key in the application?

I have an application which works with third party rest api. You can only work with this api using the key that the service I work with issues, how can I hide this key in my application in case it is decompiled?

@Override
            protected Map<String,String> getParams(){
                Map<String, String>  params = new HashMap<String, String>();
                params.put("api_key", "74413496369c0eb1e9ca067421be1b41be398f5c");
                params.put("amount", "50");
                params.put("to", "MQYSDrNwiJxr1VmLiJHNqaMtJeNon5NUGn");
                params.put("currency", "LTC");

                return params;
            }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2021-12-05
@inoise

No way, authorize users in the application via openid / oauth and let your backend access a third-party api with its key on your backend

O
Orkhan, 2021-12-06
Hasanly @azerphoenix

You should probably pay attention to Java Cryptography Extension

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question