up. 双向数据加密
This commit is contained in:
parent
1e8aac7a32
commit
dc53249596
@ -76,10 +76,10 @@ class Request extends \think\Request
|
|||||||
$key = $keyIv['key'];
|
$key = $keyIv['key'];
|
||||||
$iv = $keyIv['iv'];
|
$iv = $keyIv['iv'];
|
||||||
|
|
||||||
// 添加 PKCS#7 填充
|
// // 添加 PKCS#7 填充
|
||||||
$blockSize = 16; // AES 块大小
|
// $blockSize = 16; // AES 块大小
|
||||||
$padding = $blockSize - (strlen($data) % $blockSize);
|
// $padding = $blockSize - (strlen($data) % $blockSize);
|
||||||
$data .= str_repeat(chr($padding), $padding);
|
// $data .= str_repeat(chr($padding), $padding);
|
||||||
|
|
||||||
// AES-256-CBC 加密
|
// AES-256-CBC 加密
|
||||||
$encrypted = openssl_encrypt(
|
$encrypted = openssl_encrypt(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user