You are here

public function OpenSSL::encrypt in DRD Agent 8.3

Same name and namespace in other branches
  1. 4.0.x src/Crypt/Method/OpenSSL.php \Drupal\drd_agent\Crypt\Method\OpenSSL::encrypt()

Encrypt and encode any list of arguments.

Parameters

array $args: The arguments to be encrpyted.

Return value

string Encrypted and base64 encoded serialisation of the arguments.

Overrides BaseMethodInterface::encrypt

File

src/Crypt/Method/OpenSSL.php, line 97

Class

OpenSSL
Provides OpenSSL encryption functionality.

Namespace

Drupal\drd_agent\Crypt\Method

Code

public function encrypt(array $args) : string {
  return empty($this->password) ? '' : openssl_encrypt(serialize($args), $this->cipher, $this
    ->getPassword(), OPENSSL_RAW_DATA, $this
    ->getIv());
}