In a recent project, I’ve been using public/private key encryption to transmit data from a mobile application to an API, keeping sensitive information secure as a result. This tutorial explains how you can create your own keys, and then use them to encrypt or decrypt data using PHP and OpenSSL.
Create Public / Privacy Encryption Keys and Encrypt / Decrypt Data using PHP
3