malu/php-encrypted-transmission

PHP 加密传输

v1.0 2021-02-09 07:20 UTC

This package is not auto-updated.

Last update: 2024-10-02 00:45:45 UTC


README

加密传输

需求

PHP 5.4+ 和 PDO 扩展已安装

开始使用

通过 composer 安装

添加到 composer.json 配置文件中。

$ composer require malu/php-encrypted-transmission

并更新 composer

$ composer update
// If you installed via composer, just use this code to require autoloader on the top of your projects.
require 'vendor/autoload.php';

// Using Medoo namespace
use Malu\Encrypted\Encrypted;

$data = ["hello","malu","bbq"];

// 加密输出
$encrypt_data = Encrypted::encrypt(json_encode($data), "34f7e6dd6acf03192d82f0337c8c54ba");
echo $encrypt_data;

// 解密输出
echo Encrypted::decrypt($encrypt_data, "34f7e6dd6acf03192d82f0337c8c54ba");