-3

I want to save an unique String as variable in encrypted form and pass the variable as parameter to my PHP server in each request so that I can be sure that the request is coming from my android application not from other browsers..

I don't want others know my String even If my apk is extracted or became victim of reverse engineering. Is there any way to store a variable Like that way in encrypted form.

It would be helpful if you mention a process to Decrypt same variable with PHP.. Thanks in advance..

Shree Krishna
  • 8,474
  • 6
  • 40
  • 68

1 Answers1

1

Encrypt A String and secure even apk is extracted

The only way to accomplish the question in the title is to use asymmetric cryptography (i.e. crypto_box_seal, which prevents the Android device from ever decrypting it).

so that I can be sure that the request is coming from my android application not from other browsers.

Impossible. Anyone can create a client that emulates your APK.

Scott Arciszewski
  • 33,610
  • 16
  • 89
  • 206
  • Thanks for ur answer. It was so helpful but I want to accomplish these kind of task to my android application not in php. I didn't meant that the string is to be prevented from android device. Android application can easily be extracted and source code can be seen. so I want to prevent the hacker from seeing my string value of the variable... anyway thanks again – Shree Krishna Oct 01 '15 at 04:34