0

I have to make an app for Android which simulates an app of home banking, so I have my database and some scripts in PHP which returns data I need in JSON.

My app connects to the script and receives data but how can I encrypt the data and then send it to the app?

Is there a post method like in PHP? Can anyone tell me how to do or show me a good guide?

PHCJS
  • 445
  • 4
  • 19
user5174517
  • 301
  • 1
  • 2
  • 6

1 Answers1

1

As suggested in the comment you can always use https call.

If you still insist on encrypting the post data. You can use AES encryption. Create an API to fetch the AES key. Client will call this api to fetch the AES key.

All the post data in http request will be encrypted using this AES key. When client receives data, it will first decrypt it first and then parse it.

Please refer the below code. Simple Java AES encrypt/decrypt example

Community
  • 1
  • 1
Arpit Ratan
  • 2,976
  • 1
  • 12
  • 20
  • Please don't use that question for reference. 4 of 5 answers contain insecure code and the other good answer doesn't contain a usable example. I've just downvoted 9 answers that contain insecure code when search for a secure encryption example. [This answer](http://stackoverflow.com/a/8041442/1816580) contains all the good advice, but no example implementation. Anyway, it would be best to find an opinionated library that does everything for you. JNCryptor comes to mind. – Artjom B. Jun 14 '16 at 17:06