mirror of
https://github.com/fruithost/Panel.git
synced 2026-11-30 20:35:44 +09:00
Some PHP improvements and little fixes
This commit is contained in:
31 files changed
+182
-183
No files matched your search
@@ -2,11 +2,11 @@
|
||||
namespace fruithost;
|
||||
|
||||
class Encryption {
|
||||
public static function encrypt(string $data, string $secret) : string | false {
|
||||
public static function encrypt(string $data, #[\SensitiveParameter] string $secret) : string | false {
|
||||
return base64_encode(openssl_encrypt($data, 'aes-256-cbc', $secret, 0, substr(ENCRYPTION_SALT, 0, 16)));
|
||||
}
|
||||
|
||||
public static function decrypt(string $data, string $secret) : string | false {
|
||||
public static function decrypt(string $data, #[\SensitiveParameter] string $secret) : string | false {
|
||||
return openssl_decrypt(base64_decode($data), 'aes-256-cbc', $secret, 0, substr(ENCRYPTION_SALT, 0, 16));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user