PayPal\Security\Cipher::decrypt PHP Method

decrypt() public method

Decrypts the input text from the cipher key
public decrypt ( $input ) : string
$input
return string
    public function decrypt($input)
    {
        // Decode the IV + data
        $input = base64_decode($input);
        // Remove the IV
        $iv = substr($input, 0, Cipher::IV_SIZE);
        // Return Decrypted Data
        return openssl_decrypt(substr($input, Cipher::IV_SIZE), "AES-256-CBC", $this->secretKey, 0, $iv);
    }

Usage Example

 /**
  * Helper method to decrypt data using clientSecret as key
  *
  * @param $data
  * @return string
  */
 public function decrypt($data)
 {
     return $this->cipher->decrypt($data);
 }