PHP code example of mradang / encryption

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

    

mradang / encryption example snippets


// 加密,默认使用 AES-256-CBC 加密,$key 长度为32
$encrypter = new \mradang\Encryption\Encrypter($key);
$encrypt = $encrypter->encrypt($text);

// 解密
$encrypter = new \mradang\Encryption\Encrypter($key);
$decrypt = $encrypter->decrypt($encrypt);