src/SaveHandler/Database/CryptDatabase.php
protected function decrypt($data, $key)
    {
        $base64 = base64_decode($data, true);

        $keySize = openssl_cipher_iv_length(static::CRYPT_MODE);
        $key     = $this->generateKey($key);

        $iv      = substr($base64, 0, $keySize);
        $results = substr($base64, $keySize);

        $results = openssl_decrypt(
            $results, static::CRYPT_MODE, $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv
        );

        return $results;
    }
protected function decrypt($data, $key)
    {
        $base64 = base64_decode($data, true);

        $keySize = openssl_cipher_iv_length(static::CRYPT_MODE);
        $key     = $this->generateKey($key);

        $iv      = substr($base64, 0, $keySize);
        $results = substr($base64, $keySize);

        $results = openssl_decrypt(
            $results, static::CRYPT_MODE, $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv
        );

        return $results;
    }
Decrypt the given session data.

@param string $data Data to decrypt
@param string $key

@return string Decrypted data