(Refactor) default encryption method
This commit is contained in:
parent
1d9ac19c16
commit
bc34bb5fa0
|
@ -146,7 +146,7 @@ function encryptSettingsValue(mixed $value, $serialize = true): string
|
||||||
{
|
{
|
||||||
$appKey = getEnvironmentValue('APP_KEY');
|
$appKey = getEnvironmentValue('APP_KEY');
|
||||||
$appKey = base64_decode(Str::after($appKey, 'base64:'));
|
$appKey = base64_decode(Str::after($appKey, 'base64:'));
|
||||||
$encrypter = new Encrypter($appKey, 'AES-256-CBC');
|
$encrypter = new Encrypter($appKey);
|
||||||
$encryptedKey = $encrypter->encrypt($value, $serialize);
|
$encryptedKey = $encrypter->encrypt($value, $serialize);
|
||||||
|
|
||||||
return $encryptedKey;
|
return $encryptedKey;
|
||||||
|
@ -163,7 +163,7 @@ function decryptSettingsValue(mixed $payload, $unserialize = true)
|
||||||
{
|
{
|
||||||
$appKey = getEnvironmentValue('APP_KEY');
|
$appKey = getEnvironmentValue('APP_KEY');
|
||||||
$appKey = base64_decode(Str::after($appKey, 'base64:'));
|
$appKey = base64_decode(Str::after($appKey, 'base64:'));
|
||||||
$encrypter = new Encrypter($appKey, 'AES-256-CBC');
|
$encrypter = new Encrypter($appKey);
|
||||||
$decryptedKey = $encrypter->decrypt($payload, $unserialize);
|
$decryptedKey = $encrypter->decrypt($payload, $unserialize);
|
||||||
|
|
||||||
return $decryptedKey;
|
return $decryptedKey;
|
||||||
|
|
Loading…
Reference in a new issue