title: Cross platform data transfer with encrypting and decripting over PHP (Laravel), Android and iOS
body: <p>I am trying to create a secured message transfer system for cross platform (web, android and iOS).</p>
  
  <p>So, I want all API data transfers should be done with encryption and decryption.</p>
  
  <p>So, if an App (android and iOS) wants to send a message, that should be encrypted and the data should be decrypted by PHP and if server wants to send JSON to app, that JSOn should be encrypted and when it is received, the app will decrypt it and use that.</p>
  
  <p>As for example- let we may have a JSON response from server like this-</p>
  
  <pre><code>{
      "widget": "not-available",
      "debug": "on",
      "window": "open",
      "image": "example.widget.com/anything.jpg"
  }
  </code></pre>
  
  <p>And that should be sent by server like this-</p>
  
  <pre><code>{
      "widget": "@dsdjk4$kjh6&amp;",
      "debug": "#r$gHYUJ%",
      "window": "#jkhG%jHG%jb*kJH",
      "image": "JH4fgdt5%(0jjlkh)nl,k&amp;&amp;"
  }
  </code></pre>
  
  <p>And the app will convert it to it after decryption-</p>
  
  <pre><code>{
      "widget": "not-available",
      "debug": "on",
      "window": "open",
      "image": "example.widget.com/anything.jpg"
  }
  </code></pre>
  
  <p>Is there any common way to do that?</p>
  
  <p>If yes, then please let me know.
  I don't need the whole code (if any example is provided, it will be more helpful), but please let me know where can I find the solution.</p>