Files

18 lines
434 B
PHP
Raw Permalink Normal View History

2025-11-10 16:12:07 +08:00
<?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'));
}
}