You are here

public function OpenSSL::decrypt 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::decrypt()

Decode, decrypt and unserialize arguments from the other end.

Parameters

string $body: The encrypted, serialized and encoded string to process.

string $iv: The initialiation vector.

Return value

mixed The decoded, decrypted and unserialized arguments.

Overrides BaseMethodInterface::decrypt

File

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

Class

OpenSSL
Provides OpenSSL encryption functionality.

Namespace

Drupal\drd_agent\Crypt\Method

Code

public function decrypt($body, $iv) {
  $this->iv = $iv;

  /** @noinspection UnserializeExploitsInspection */
  return unserialize(openssl_decrypt($body, $this->cipher, $this
    ->getPassword(), OPENSSL_RAW_DATA, $this->iv));
}