Files
charge-pile-serve/app/controller/Aes.php
MeSHard 94f7e83679 init
2025-11-10 16:12:07 +08:00

18 lines
434 B
PHP

<?php
namespace app\controller;
class Aes
{
public function encrypt($input)
{
return base64_encode(openssl_encrypt($input, 'AES-128-CBC', config('hard.DataSecret'), OPENSSL_RAW_DATA, config('hard.DataSecretIV')));
}
public function decrypt($input)
{
return openssl_decrypt(base64_decode($input), 'AES-128-CBC', config('hard.DataSecret'), OPENSSL_RAW_DATA, config('hard.DataSecretIV'));
}
}