title: Encrypt json data with secret key on IOS and decrypt it with node js
body: <p>I need to protect my API for CSRF on post and put requests.</p>
  
  <p>To do that, I think the mobile device (example iOS) need to send to the API server (node.js) a token. This token must be encrypted and contain a <code>JSON</code> data that will be decrypted server side.</p>
  
  <p>To decrypt the data, the mobile device use the same secret key that the sever know.</p>
  
  <p>For example : <code>{_csrf: 123456789}</code> will be decrypted from the token sent via the mobile device and checked by the API if it match.</p>
  
  <ol>
  <li><p>Is it the right way ? If not what is the right way ?</p></li>
  <li><p>How I can encrypt a Jon data on iOS and decrypt it on node.js ? (JWT Token does not have library for iOS)</p></li>
  </ol>
  
  <p>Can you provide me a example code to encrypt data on iOS et decrypt on node.js ?</p>