1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Encryptor.php
См. документацию.
1<?php
2
3namespace Bitrix\MessageService\Providers;
4
5use Bitrix\Main\Security\Cipher;
6
7trait Encryptor
8{
9 protected static function encrypt(string $data, string $cryptoKey): string
10 {
11 $encryptedData = '';
12 try
13 {
14 $cipher = new Cipher();
15
16 $encryptedData = $cipher->encrypt($data, $cryptoKey);
17 $encryptedData = \base64_encode($encryptedData);
18 }
19 catch (\Bitrix\Main\Security\SecurityException $e)
20 {}
21
22 return $encryptedData;
23 }
24
25 protected static function decrypt(string $encryptedData, string $cryptoKey): string
26 {
27 $decryptedData = '';
28 try
29 {
30 $cipher = new Cipher();
31
32 $decryptedData = base64_decode($encryptedData);
33 $decryptedData = $cipher->decrypt($decryptedData, $cryptoKey);
34 }
35 catch(\Bitrix\Main\Security\SecurityException $e)
36 {}
37
38 return $decryptedData;
39 }
40}
decrypt($data, $key)
Определения cipher.php:91
encrypt($data, $key)
Определения cipher.php:52
if(isValidSign($key, $signedUserToken)===false) $decryptedData
Определения quickway.php:264
if(!empty( $_GET[ 'ts']) &&$_GET[ 'ts']==='bxviewer') if(!empty($_GET['_gen'])) $encryptedData
Определения quickway.php:13