PHP code example of nyg / aes

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

    

nyg / aes example snippets

 php
use Nyg\Aes;


/*待签名数组*/
$data=['name'=>'张三','email'=>'[email protected]'];

/*密钥*/
$key='4r5ewt64ewt78tr7ey8e9y7';

/*生成签名sign*/
$sign=Aes::sign_encrypt($data,$key);
echo $sign."\n\r";

/*验签*/
$bool=Aes::sign_decrypt($data,$sign,$key);
var_dump($bool);