src/SecureString.php
protected function decrypt($str, $method, $password, $throw = false) {
        $iv = static::base64urlDecode($this->popString($str));
        $encrypted = static::base64urlDecode($this->popString($str));

        try {
            $decrypted = openssl_decrypt($encrypted, $method, $password, true, $iv);
        } catch (\Exception $ex) {
            return $this->exception($throw, "Error decrypting the string.", 403);
        }

        if ($decrypted === false) {
            return $this->exception($throw, "Error decrypting the string.", 403);
        }

        return $decrypted;
    }
protected function decrypt($str, $method, $password, $throw = false) {
        $iv = static::base64urlDecode($this->popString($str));
        $encrypted = static::base64urlDecode($this->popString($str));

        try {
            $decrypted = openssl_decrypt($encrypted, $method, $password, true, $iv);
        } catch (\Exception $ex) {
            return $this->exception($throw, "Error decrypting the string.", 403);
        }

        if ($decrypted === false) {
            return $this->exception($throw, "Error decrypting the string.", 403);
        }

        return $decrypted;
    }
Decrypt a string with {@link openssl_decrypt()}.

@param string $str The base64 url encoded encrypted string.
@param string $method The encryption cipher.
@param string $password The password to decyrpt the string.
@param bool $throw Whether or not to decode the string on exception.
@return string|null Returns the decrypted string or null on error.