A simple toolset for working with RSA encryption in PHP.
Just require the package using composer.
composer require naylonkessler/simple-rsa-cryptor-php
Just import, instantiate and call:
<?php
use SimpleRSACryptor\Cryptor;
use SimpleRSACryptor\Keys\PublicKey;
use SimpleRSACryptor\Keys\PrivateKey;
$publicKey = new PublicKey('path-to-public-key-file.pem');
$privateKey = new PrivateKey('path-to-private-key-file.pem');
$passPhrase = 'pass phrase of private key';
$cryptor = new Cryptor($publicKey, $privateKey, $passPhrase);
$encrypted = $cryptor->encrypt('Some data');
$decrypted = $cryptor->decrypt($encrypted);
echo $decrypted;
TBD
TBD
TBD