main
inicio
This commit is contained in:
12
app/helpers/crypto.php
Normal file
12
app/helpers/crypto.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
function encrypt($data) {
|
||||
$key = $_ENV['ENCRYPTION_KEY'];
|
||||
$iv = $_ENV['ENCRYPTION_IV'];
|
||||
return base64_encode(openssl_encrypt($data, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv));
|
||||
}
|
||||
|
||||
function decrypt($data) {
|
||||
$key = $_ENV['ENCRYPTION_KEY'];
|
||||
$iv = $_ENV['ENCRYPTION_IV'];
|
||||
return openssl_decrypt(base64_decode($data), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);
|
||||
}
|
||||
Reference in New Issue
Block a user