Here is an easy way to do this:
- You save everything related to the Google user ID for both applications.
- You share data using HTTP requests containing the user ID.
- To prevent leakage of user IDs (prohibited by the API of the account) and to check whether the messages really come from another application, you encrypt requests using a symmetric cipher like AES or Blowfish, or as you like. Both applications have the same key.
You can use public key cryptography. Having only two applications, in my opinion it is not worth it. If you are starting to have more applications, a public key makes sense.
Precise printing: encryption does not guarantee integrity or origin without additional measures. You need to take precautions against playback, for example by including a time stamp or serial number. You need to take precautions against counterfeiting, for example. with a checksum. Be sure to use CBC and good initialization vectors. Keep the key secret.
source share