PHP code example of darkdevlab / encryptor

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

    

darkdevlab / encryptor example snippets


use DarkDevLab\Encryptor\Cipher;

var_dump(
    Cipher::getList()
);

use DarkDevLab\Encryptor\OpenSslEncryptor;
use DarkDevLab\Encryptor\Cipher;

$encryptor = new OpenSslEncryptor('secret_key', Cipher::get(Cipher::AES_256_CBC));
$encryptedString = $encryptor->encrypt('{"data":"to", "encryption":12345}');
$decryptedString = $encryptor->decrypt($encryptedString);