PHP code example of jsoltani / js-rsa-crypt

1. Go to this page and download the library: Download jsoltani/js-rsa-crypt library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jsoltani / js-rsa-crypt example snippets


php composer.phar 

$crypt = new jsRsaCrypt();

//$crypt->genKeys(512);
$crypt->setPublicKey('public.pem');
$crypt->setPrivateKey('private.pem');
$data = $crypt->encrypt("Test Crypt");

echo "Encrypt: $data <br>";
echo "Decrypt: " . $crypt->decrypt($data);