9 protected static function encrypt(
string $data,
string $cryptoKey): string
14 $cipher =
new Cipher();
16 $encryptedData = $cipher->encrypt($data, $cryptoKey);
17 $encryptedData = \base64_encode($encryptedData);
19 catch (\
Bitrix\Main\Security\SecurityException $e)
22 return $encryptedData;
25 protected static function decrypt(
string $encryptedData,
string $cryptoKey): string
30 $cipher =
new Cipher();
32 $decryptedData = base64_decode($encryptedData);
33 $decryptedData = $cipher->decrypt($decryptedData, $cryptoKey);
35 catch(\
Bitrix\Main\Security\SecurityException $e)
38 return $decryptedData;