Skip to content

Commit 046441e

Browse files
committed
replace placeholder with actual env var key
1 parent febd9fc commit 046441e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Libraries/Security.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ public static function encrypt(string $plaintext): string
3232
{
3333
$plaintext = hex2bin($plaintext);
3434
if (!$plaintext) {
35-
throw new Exception("failed to convert plaintext into bin");
35+
throw new \Exception("failed to convert plaintext into bin");
3636
}
37-
$ecrypted = openssl_encrypt($plaintext, "AES-128-CBC", "xxx", OPENSSL_ZERO_PADDING, "ivx");
37+
$ecrypted = openssl_encrypt($plaintext, "AES-128-CBC", env('SECURITY_KEY'), OPENSSL_ZERO_PADDING, env('SECURITY_IV_KEY'));
3838
if (!$ecrypted) {
39-
throw new Exception("failed to encrypt string");
39+
throw new \Exception("failed to encrypt string");
4040
}
4141
return $ecrypted;
4242
}

0 commit comments

Comments
 (0)