PHP code example of noprotocol / php-mysql-aes-crypt

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

    

noprotocol / php-mysql-aes-crypt example snippets



NoProtocol\Encryption\MySQL\AES\Crypter;


NoProtocol\Encryption\MySQL\AES\Crypter;


use NoProtocol\Encryption\MySQL\AES\Crypter;

// create a new instance
$crypter = new Crypter('mykeystring');

// encrypt a piece of data
$encrypted = $crypter->encrypt('foobar');

// decrypt a piece of data
$decrypted = $crypter->decrypt($encrypted);

$crypter = new Crypter('mykeystring', 'AES-256-ECB');

$ composer