PHP code example of webnarmin / cryptor
1. Go to this page and download the library: Download webnarmin/cryptor 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/ */
webnarmin / cryptor example snippets
ebnarmin\Cryptor\Cryptor;
$privateKey = 'your_private_key';
$publicKey = 'your_public_key';
$data = 'Hello, world!';
$cryptor = new Cryptor($privateKey);
$encryptedData = $cryptor->encrypt($data, $publicKey);
echo 'Encrypted Data: ' . $encryptedData;
ebnarmin\Cryptor\Cryptor;
$privateKey = 'your_private_key';
$publicKey = 'your_public_key';
$encryptedData = 'your_encrypted_data';
$cryptor = new Cryptor($privateKey);
$decryptedData = $cryptor->decrypt($encryptedData, $publicKey);
echo 'Decrypted Data: ' . $decryptedData;