PHP code example of phelium / encryptor

1. Go to this page and download the library: Download phelium/encryptor 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/ */

    

phelium / encryptor example snippets


use Phelium\Component\Encryptor;

$encryptor = new Encryptor();
$encryptor->setKey('my-super-key');

$encryptedString = $encryptor->encrypt('my string');
echo $encryptedString;

$decryptedString = $encryptor->decrypt($encryptedString);
echo $decryptedString; // Outputs "my string"

$encryptor->setCipherAlgorithm('aes-192-cbc');

$secureKey = Encryptor::generateKey();
echo $secureKey;