PHP code example of fengdangxing / php-aes

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

    

fengdangxing / php-aes example snippets


return [
    'fengdangxing' => [
        'encrypt' => [
            'method' => 'AES-128-CBC',// Encryption methods: AES-256-CBC
            'key' => 'Y6eENzQ69OKqRaHE',// secret key
            'iv' => 'qweNzsd9OKJOIJoo',// offset key
        ]
    ]
];



    $str =  \Fengdangxing\Aes\Aes::encrypt("121212");
    echo $str.PHP_EOL;
    echo \Fengdangxing\Aes\Aes::decrypt($str);