PHP DES加解密类 兼容openssl方式

时间:2022-07-23 11:20:44
【文件属性】:

文件名称:PHP DES加解密类 兼容openssl方式

文件大小:4KB

文件格式:ZIP

更新时间:2022-07-23 11:20:44

DES DES加密 DES解密

<?php $data = [ 'name' => 'Tom', 'age' => 20, 'sex' => 'm', 'contry' => '英国' ]; //php 7.1以下 require_once "Des.php"; $des = Des::share('key', 'asdfglkj'); // $encrypt = $des->encrypt(json_encode($data)); echo 'DES加密后:'.$encrypt.'
'; $decrypt = $des->decrypt($encrypt); echo 'DES解密后:'.$decrypt.'
'; //openssl 方式兼容上方 require_once "Des71.php"; $des = Des71::share('key', 'asdfglkj'); //asdfglkj $encrypt = $des->encrypt(json_encode($data)); echo 'DES加密后:'.$encrypt.'
'; $decrypt = $des->decrypt($encrypt); echo 'DES解密后:'.$decrypt.'
';


【文件预览】:
Des.php
Des71.php

网友评论