PHP code example of limingxinleo / i-encryption

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

    

limingxinleo / i-encryption example snippets




declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  [email protected]
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
return [
    'default' => [
        'key' => '',
        'cipher' => '',
    ],
];


use Hyperf\Utils\ApplicationContext;
use Illuminate\Encryption\Contracts\Encrypter;

$encrypter = ApplicationContext::getContainer()->get(Encrypter::class);

$encrypted = $encrypter->encrypt('foo');
$decrypted = $encrypter->decrypt($encrypted);