init
This commit is contained in:
18
app/controller/Aes.php
Normal file
18
app/controller/Aes.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user