Bitrix API

Cipher

Table of Contents

Methods

__construct()  : mixed
Cipher constructor. Aes-256-ctr and sha256 are the best currently known methods.
decrypt()  : string
Decrypts the data by key (symmetric cipher).
encrypt()  : string
Encrypts the data by key (symmetric cipher).

Methods

__construct()

Cipher constructor. Aes-256-ctr and sha256 are the best currently known methods.

public __construct([string $cipherAlgorithm = 'aes-256-ctr' ][, string $hashAlgorithm = 'sha256' ][, bool $calculateHash = true ]) : mixed
Parameters
$cipherAlgorithm : string = 'aes-256-ctr'
$hashAlgorithm : string = 'sha256'
$calculateHash : bool = true
Tags
throws
SecurityException

decrypt()

Decrypts the data by key (symmetric cipher).

public decrypt(string $data, string $key) : string
Parameters
$data : string

Binary data

$key : string
Tags
throws
SecurityException
Return values
string

encrypt()

Encrypts the data by key (symmetric cipher).

public encrypt(string $data, string $key) : string
Parameters
$data : string
$key : string
Tags
throws
SecurityException
Return values
string

Binary data.


        
On this page

Search results