Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php include_once "\125\x74\x69\154\x69\x74\151\145\163\56\160\x68\x70"; class SAML..

Decoded Output download

<?php 
 
 
include_once "Utilities.php"; 
class SAML2_LogoutRequest 
{ 
    private $tagName; 
    private $id; 
    private $issuer; 
    private $destination; 
    private $issueInstant; 
    private $certificates; 
    private $validators; 
    private $notOnOrAfter; 
    private $encryptedNameId; 
    private $nameId; 
    private $sessionIndexes; 
    public function __construct(DOMElement $Zu = NULL) 
    { 
        $this->tagName = "LogoutRequest"; 
        $this->id = Utilities::generateID(); 
        $this->issueInstant = time(); 
        $this->certificates = array(); 
        $this->validators = array(); 
        if (!($Zu === NULL)) { 
            goto Xa; 
        } 
        return; 
        Xa: 
        if ($Zu->hasAttribute("ID")) { 
            goto Bl; 
        } 
        throw new Exception("Missing ID attribute on SAML message."); 
        Bl: 
        $this->id = $Zu->getAttribute("ID"); 
        if (!($Zu->getAttribute("Version") !== "2.0")) { 
            goto Sr; 
        } 
        throw new Exception("Unsupported version: " . $Zu->getAttribute("Version")); 
        Sr: 
        $this->issueInstant = Utilities::xsDateTimeToTimestamp($Zu->getAttribute("IssueInstant")); 
        if (!$Zu->hasAttribute("Destination")) { 
            goto ER; 
        } 
        $this->destination = $Zu->getAttribute("Destination"); 
        ER: 
        $xJ = Utilities::xpQuery($Zu, "./saml_assertion:Issuer"); 
        if (empty($xJ)) { 
            goto GB; 
        } 
        $this->issuer = trim($xJ[0]->textContent); 
        GB: 
        try { 
            $Cm = Utilities::validateElement($Zu); 
            if (!($Cm !== FALSE)) { 
                goto ZH; 
            } 
            $this->certificates = $Cm["Certificates"]; 
            $this->validators[] = array("Function" => array("Utilities", "validateSignature"), "Data" => $Cm); 
            ZH: 
        } catch (Exception $YJ) { 
        } 
        $this->sessionIndexes = array(); 
        if (!$Zu->hasAttribute("NotOnOrAfter")) { 
            goto n4; 
        } 
        $this->notOnOrAfter = Utilities::xsDateTimeToTimestamp($Zu->getAttribute("NotOnOrAfter")); 
        n4: 
        $jj = Utilities::xpQuery($Zu, "./saml_assertion:NameID | ./saml_assertion:EncryptedID/xenc:EncryptedData"); 
        if (empty($jj)) { 
            goto TL; 
        } 
        if (count($jj) > 1) { 
            goto U_; 
        } 
        goto NT; 
        TL: 
        throw new Exception("Missing <saml:NameID> or <saml:EncryptedID> in <samlp:LogoutRequest>."); 
        goto NT; 
        U_: 
        throw new Exception("More than one <saml:NameID> or <saml:EncryptedD> in <samlp:LogoutRequest>."); 
        NT: 
        $jj = $jj[0]; 
        if ($jj->localName === "EncryptedData") { 
            goto fw; 
        } 
        $this->nameId = Utilities::parseNameId($jj); 
        goto nV; 
        fw: 
        $this->encryptedNameId = $jj; 
        nV: 
        $tu = Utilities::xpQuery($Zu, "./saml_protocol:SessionIndex"); 
        foreach ($tu as $FZ) { 
            $this->sessionIndexes[] = trim($FZ->textContent); 
            i3: 
        } 
        TQ: 
    } 
    public function getNotOnOrAfter() 
    { 
        return $this->notOnOrAfter; 
    } 
    public function setNotOnOrAfter($k7) 
    { 
        $this->notOnOrAfter = $k7; 
    } 
    public function isNameIdEncrypted() 
    { 
        if (!($this->encryptedNameId !== NULL)) { 
            goto ET; 
        } 
        return TRUE; 
        ET: 
        return FALSE; 
    } 
    public function encryptNameId(XMLSecurityKey $OE) 
    { 
        $CI = new DOMDocument(); 
        $ai = $CI->createElement("root"); 
        $CI->appendChild($ai); 
        SAML2_Utils::addNameId($ai, $this->nameId); 
        $jj = $ai->firstChild; 
        SAML2_Utils::getContainer()->debugMessage($jj, "encrypt"); 
        $GN = new XMLSecEnc(); 
        $GN->setNode($jj); 
        $GN->type = XMLSecEnc::Element; 
        $o4 = new XMLSecurityKey(XMLSecurityKey::AES128_CBC); 
        $o4->generateSessionKey(); 
        $GN->encryptKey($OE, $o4); 
        $this->encryptedNameId = $GN->encryptNode($o4); 
        $this->nameId = NULL; 
    } 
    public function decryptNameId(XMLSecurityKey $OE, array $uu = array()) 
    { 
        if (!($this->encryptedNameId === NULL)) { 
            goto qX; 
        } 
        return; 
        qX: 
        $jj = SAML2_Utils::decryptElement($this->encryptedNameId, $OE, $uu); 
        SAML2_Utils::getContainer()->debugMessage($jj, "decrypt"); 
        $this->nameId = SAML2_Utils::parseNameId($jj); 
        $this->encryptedNameId = NULL; 
    } 
    public function getNameId() 
    { 
        if (!($this->encryptedNameId !== NULL)) { 
            goto kg; 
        } 
        throw new Exception("Attempted to retrieve encrypted NameID without decrypting it first."); 
        kg: 
        return $this->nameId; 
    } 
    public function setNameId($jj) 
    { 
        $this->nameId = $jj; 
    } 
    public function getSessionIndexes() 
    { 
        return $this->sessionIndexes; 
    } 
    public function setSessionIndexes(array $tu) 
    { 
        $this->sessionIndexes = $tu; 
    } 
    public function getSessionIndex() 
    { 
        if (!empty($this->sessionIndexes)) { 
            goto nt; 
        } 
        return NULL; 
        nt: 
        return $this->sessionIndexes[0]; 
    } 
    public function setSessionIndex($FZ) 
    { 
        if (is_null($FZ)) { 
            goto pQ; 
        } 
        $this->sessionIndexes = array($FZ); 
        goto fz; 
        pQ: 
        $this->sessionIndexes = array(); 
        fz: 
    } 
    public function toUnsignedXML() 
    { 
        $ai = parent::toUnsignedXML(); 
        if (!($this->notOnOrAfter !== NULL)) { 
            goto JS; 
        } 
        $ai->setAttribute("NotOnOrAfter", gmdate("Y-m-d\TH:i:s\Z", $this->notOnOrAfter)); 
        JS: 
        if ($this->encryptedNameId === NULL) { 
            goto g_; 
        } 
        $ra = $ai->ownerDocument->createElementNS(SAML2_Const::NS_SAML, "saml:" . "EncryptedID"); 
        $ai->appendChild($ra); 
        $ra->appendChild($ai->ownerDocument->importNode($this->encryptedNameId, TRUE)); 
        goto By; 
        g_: 
        SAML2_Utils::addNameId($ai, $this->nameId); 
        By: 
        foreach ($this->sessionIndexes as $FZ) { 
            SAML2_Utils::addString($ai, SAML2_Const::NS_SAMLP, "SessionIndex", $FZ); 
            Qo: 
        } 
        f6: 
        return $ai; 
    } 
    public function getId() 
    { 
        return $this->id; 
    } 
    public function setId($L8) 
    { 
        $this->id = $L8; 
    } 
    public function getIssueInstant() 
    { 
        return $this->issueInstant; 
    } 
    public function setIssueInstant($rz) 
    { 
        $this->issueInstant = $rz; 
    } 
    public function getDestination() 
    { 
        return $this->destination; 
    } 
    public function setDestination($UU) 
    { 
        $this->destination = $UU; 
    } 
    public function getIssuer() 
    { 
        return $this->issuer; 
    } 
    public function setIssuer($xJ) 
    { 
        $this->issuer = $xJ; 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php


include_once "\125\x74\x69\154\x69\x74\151\145\163\56\160\x68\x70";
class SAML2_LogoutRequest
{
    private $tagName;
    private $id;
    private $issuer;
    private $destination;
    private $issueInstant;
    private $certificates;
    private $validators;
    private $notOnOrAfter;
    private $encryptedNameId;
    private $nameId;
    private $sessionIndexes;
    public function __construct(DOMElement $Zu = NULL)
    {
        $this->tagName = "\x4c\157\x67\x6f\165\x74\122\145\x71\x75\x65\x73\164";
        $this->id = Utilities::generateID();
        $this->issueInstant = time();
        $this->certificates = array();
        $this->validators = array();
        if (!($Zu === NULL)) {
            goto Xa;
        }
        return;
        Xa:
        if ($Zu->hasAttribute("\111\104")) {
            goto Bl;
        }
        throw new Exception("\115\x69\x73\163\x69\x6e\147\40\111\x44\x20\141\x74\164\x72\x69\x62\165\164\145\x20\x6f\x6e\x20\123\101\115\x4c\x20\x6d\145\163\163\141\x67\145\56");
        Bl:
        $this->id = $Zu->getAttribute("\x49\x44");
        if (!($Zu->getAttribute("\x56\145\162\x73\151\157\x6e") !== "\62\56\60")) {
            goto Sr;
        }
        throw new Exception("\125\156\x73\165\160\x70\x6f\162\164\x65\144\40\166\x65\162\163\151\x6f\x6e\72\x20" . $Zu->getAttribute("\126\145\x72\x73\x69\x6f\x6e"));
        Sr:
        $this->issueInstant = Utilities::xsDateTimeToTimestamp($Zu->getAttribute("\x49\163\163\x75\x65\x49\x6e\x73\164\141\x6e\164"));
        if (!$Zu->hasAttribute("\x44\145\163\x74\x69\156\x61\x74\x69\157\156")) {
            goto ER;
        }
        $this->destination = $Zu->getAttribute("\x44\145\163\x74\151\156\141\x74\x69\x6f\156");
        ER:
        $xJ = Utilities::xpQuery($Zu, "\56\x2f\x73\x61\x6d\154\137\141\x73\163\145\162\x74\x69\157\156\72\x49\x73\x73\x75\x65\162");
        if (empty($xJ)) {
            goto GB;
        }
        $this->issuer = trim($xJ[0]->textContent);
        GB:
        try {
            $Cm = Utilities::validateElement($Zu);
            if (!($Cm !== FALSE)) {
                goto ZH;
            }
            $this->certificates = $Cm["\x43\145\x72\164\151\146\151\x63\x61\164\x65\x73"];
            $this->validators[] = array("\106\165\x6e\143\164\x69\157\x6e" => array("\125\x74\151\154\151\x74\x69\x65\x73", "\x76\141\154\x69\144\x61\164\x65\123\x69\147\156\x61\164\165\x72\145"), "\x44\x61\x74\x61" => $Cm);
            ZH:
        } catch (Exception $YJ) {
        }
        $this->sessionIndexes = array();
        if (!$Zu->hasAttribute("\116\x6f\x74\x4f\156\x4f\162\x41\146\164\x65\x72")) {
            goto n4;
        }
        $this->notOnOrAfter = Utilities::xsDateTimeToTimestamp($Zu->getAttribute("\116\157\x74\117\x6e\117\162\101\146\x74\x65\162"));
        n4:
        $jj = Utilities::xpQuery($Zu, "\x2e\57\163\141\155\154\137\x61\x73\163\x65\x72\x74\151\x6f\156\72\x4e\141\155\145\111\104\x20\x7c\40\56\57\x73\141\x6d\x6c\137\141\163\x73\x65\162\x74\x69\x6f\x6e\72\x45\156\x63\x72\171\160\164\x65\x64\x49\104\57\x78\x65\156\143\72\105\x6e\x63\162\x79\x70\164\145\144\x44\x61\x74\x61");
        if (empty($jj)) {
            goto TL;
        }
        if (count($jj) > 1) {
            goto U_;
        }
        goto NT;
        TL:
        throw new Exception("\x4d\151\x73\163\151\156\x67\40\x3c\163\x61\x6d\154\72\116\x61\x6d\145\111\x44\76\40\x6f\x72\40\x3c\163\141\155\x6c\x3a\x45\x6e\x63\162\x79\x70\164\145\x64\x49\104\76\x20\x69\156\x20\x3c\x73\141\155\x6c\x70\72\x4c\x6f\x67\x6f\x75\x74\x52\145\161\165\x65\x73\x74\76\x2e");
        goto NT;
        U_:
        throw new Exception("\115\157\x72\x65\40\164\x68\141\x6e\x20\x6f\x6e\x65\x20\74\x73\x61\x6d\x6c\x3a\116\141\155\x65\111\104\x3e\x20\157\162\x20\74\x73\x61\x6d\x6c\x3a\105\x6e\143\x72\171\x70\x74\x65\144\x44\76\40\x69\156\40\74\x73\x61\155\x6c\x70\x3a\x4c\157\147\157\165\164\122\145\161\165\x65\x73\x74\76\56");
        NT:
        $jj = $jj[0];
        if ($jj->localName === "\105\156\143\x72\171\160\164\145\144\104\x61\164\x61") {
            goto fw;
        }
        $this->nameId = Utilities::parseNameId($jj);
        goto nV;
        fw:
        $this->encryptedNameId = $jj;
        nV:
        $tu = Utilities::xpQuery($Zu, "\x2e\57\x73\x61\155\154\137\160\x72\157\x74\x6f\x63\x6f\154\72\x53\145\163\163\151\x6f\156\x49\x6e\x64\145\170");
        foreach ($tu as $FZ) {
            $this->sessionIndexes[] = trim($FZ->textContent);
            i3:
        }
        TQ:
    }
    public function getNotOnOrAfter()
    {
        return $this->notOnOrAfter;
    }
    public function setNotOnOrAfter($k7)
    {
        $this->notOnOrAfter = $k7;
    }
    public function isNameIdEncrypted()
    {
        if (!($this->encryptedNameId !== NULL)) {
            goto ET;
        }
        return TRUE;
        ET:
        return FALSE;
    }
    public function encryptNameId(XMLSecurityKey $OE)
    {
        $CI = new DOMDocument();
        $ai = $CI->createElement("\162\157\x6f\164");
        $CI->appendChild($ai);
        SAML2_Utils::addNameId($ai, $this->nameId);
        $jj = $ai->firstChild;
        SAML2_Utils::getContainer()->debugMessage($jj, "\x65\156\x63\x72\x79\x70\x74");
        $GN = new XMLSecEnc();
        $GN->setNode($jj);
        $GN->type = XMLSecEnc::Element;
        $o4 = new XMLSecurityKey(XMLSecurityKey::AES128_CBC);
        $o4->generateSessionKey();
        $GN->encryptKey($OE, $o4);
        $this->encryptedNameId = $GN->encryptNode($o4);
        $this->nameId = NULL;
    }
    public function decryptNameId(XMLSecurityKey $OE, array $uu = array())
    {
        if (!($this->encryptedNameId === NULL)) {
            goto qX;
        }
        return;
        qX:
        $jj = SAML2_Utils::decryptElement($this->encryptedNameId, $OE, $uu);
        SAML2_Utils::getContainer()->debugMessage($jj, "\144\x65\143\x72\171\160\x74");
        $this->nameId = SAML2_Utils::parseNameId($jj);
        $this->encryptedNameId = NULL;
    }
    public function getNameId()
    {
        if (!($this->encryptedNameId !== NULL)) {
            goto kg;
        }
        throw new Exception("\x41\164\x74\x65\x6d\x70\x74\145\x64\40\x74\x6f\40\x72\x65\164\162\x69\145\166\x65\x20\x65\156\143\x72\171\160\164\x65\144\x20\x4e\x61\155\x65\x49\x44\x20\167\151\164\150\x6f\x75\x74\40\x64\x65\143\162\x79\x70\164\151\156\x67\40\x69\x74\x20\x66\151\x72\x73\x74\56");
        kg:
        return $this->nameId;
    }
    public function setNameId($jj)
    {
        $this->nameId = $jj;
    }
    public function getSessionIndexes()
    {
        return $this->sessionIndexes;
    }
    public function setSessionIndexes(array $tu)
    {
        $this->sessionIndexes = $tu;
    }
    public function getSessionIndex()
    {
        if (!empty($this->sessionIndexes)) {
            goto nt;
        }
        return NULL;
        nt:
        return $this->sessionIndexes[0];
    }
    public function setSessionIndex($FZ)
    {
        if (is_null($FZ)) {
            goto pQ;
        }
        $this->sessionIndexes = array($FZ);
        goto fz;
        pQ:
        $this->sessionIndexes = array();
        fz:
    }
    public function toUnsignedXML()
    {
        $ai = parent::toUnsignedXML();
        if (!($this->notOnOrAfter !== NULL)) {
            goto JS;
        }
        $ai->setAttribute("\116\157\x74\117\x6e\x4f\162\x41\146\x74\x65\x72", gmdate("\131\x2d\155\55\x64\x5c\x54\110\x3a\151\x3a\x73\x5c\132", $this->notOnOrAfter));
        JS:
        if ($this->encryptedNameId === NULL) {
            goto g_;
        }
        $ra = $ai->ownerDocument->createElementNS(SAML2_Const::NS_SAML, "\163\141\x6d\x6c\72" . "\x45\x6e\143\162\x79\x70\164\145\x64\x49\104");
        $ai->appendChild($ra);
        $ra->appendChild($ai->ownerDocument->importNode($this->encryptedNameId, TRUE));
        goto By;
        g_:
        SAML2_Utils::addNameId($ai, $this->nameId);
        By:
        foreach ($this->sessionIndexes as $FZ) {
            SAML2_Utils::addString($ai, SAML2_Const::NS_SAMLP, "\123\x65\x73\163\x69\x6f\156\x49\156\144\145\170", $FZ);
            Qo:
        }
        f6:
        return $ai;
    }
    public function getId()
    {
        return $this->id;
    }
    public function setId($L8)
    {
        $this->id = $L8;
    }
    public function getIssueInstant()
    {
        return $this->issueInstant;
    }
    public function setIssueInstant($rz)
    {
        $this->issueInstant = $rz;
    }
    public function getDestination()
    {
        return $this->destination;
    }
    public function setDestination($UU)
    {
        $this->destination = $UU;
    }
    public function getIssuer()
    {
        return $this->issuer;
    }
    public function setIssuer($xJ)
    {
        $this->issuer = $xJ;
    }
}

Function Calls

None

Variables

None

Stats

MD5 88ac822417e1d13d1c79337aa8608ed9
Eval Count 0
Decode Time 83 ms