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 if (!class_exists("CodeDecryptor")) { class CodeDecryptor { private..

Decoded Output download

<?php 
 
if (!class_exists("CodeDecryptor")) { 
    class CodeDecryptor { 
        private $encryptedCode; 
        private $secretKey; 
 
        public function __construct($encryptedCode, $key) { 
            $this->encryptedCode = $encryptedCode; 
            $this->secretKey = hex2bin($key); 
        } 
 
        public function decrypt() { 
            $data = base64_decode($this->encryptedCode); 
            $iv = substr($data, 0, 16); 
            $hmac = substr($data, 16, 32); 
            $cipherText = substr($data, 48); 
            $calculatedHmac = hash_hmac("sha256", $cipherText, $this->secretKey, true); 
            if (!hash_equals($hmac, $calculatedHmac)) { 
                throw new Exception("HMAC verification failed."); 
            } 
            return openssl_decrypt($cipherText, "AES-256-CBC", $this->secretKey, OPENSSL_RAW_DATA, $iv); 
        } 
    } 
 
    $decryptor = new CodeDecryptor("Y4Ucjpe4nlJF+5gITbSa81Do29LLUtiVGbc3d7nNVdyPu6mwndwACAvdWyXlaoMTZurjiKN1uDHuBpZYXm1w94r0hJuD3bVW3cS6PolWVOQH3xP1fC3c746cJoRcTQsmt+SdkDmKLAotg/jtl7uFTmyjCMUGCjCSElPX1N7PDRZGazCQFM6TnyoEEL8q0O6k3F7cvKT50i9Lj/8BHiMVOAgZvgBMPR6znDsaE2RrkrUFDqG/UMjvcvrIboTLmvWcFNHTitft/TACOzrZp3e2+zrIrMlKVXuXKhf8iItOQ1GJRMJLH4W2M+hQc+4gqADORbtpO9hAJHampNsYuUhJD/VBfTewCndAGP8bhTDV8MFN9JLroh1+EYmI/ypj94iMjsj2eii6iEuxoFbEJ06e7g==", "3e9ba237550d7d1c29b0fd6661b3fec27c5495504ae634252113128ff8e54a9e"); 
    $code = $decryptor->decrypt(); 
    eval($code); 
} 
 
?>

Did this file decode correctly?

Original Code

<?php

if (!class_exists("CodeDecryptor")) {
    class CodeDecryptor {
        private $encryptedCode;
        private $secretKey;

        public function __construct($encryptedCode, $key) {
            $this->encryptedCode = $encryptedCode;
            $this->secretKey = hex2bin($key);
        }

        public function decrypt() {
            $data = base64_decode($this->encryptedCode);
            $iv = substr($data, 0, 16);
            $hmac = substr($data, 16, 32);
            $cipherText = substr($data, 48);
            $calculatedHmac = hash_hmac("sha256", $cipherText, $this->secretKey, true);
            if (!hash_equals($hmac, $calculatedHmac)) {
                throw new Exception("HMAC verification failed.");
            }
            return openssl_decrypt($cipherText, "AES-256-CBC", $this->secretKey, OPENSSL_RAW_DATA, $iv);
        }
    }

    $decryptor = new CodeDecryptor("Y4Ucjpe4nlJF+5gITbSa81Do29LLUtiVGbc3d7nNVdyPu6mwndwACAvdWyXlaoMTZurjiKN1uDHuBpZYXm1w94r0hJuD3bVW3cS6PolWVOQH3xP1fC3c746cJoRcTQsmt+SdkDmKLAotg/jtl7uFTmyjCMUGCjCSElPX1N7PDRZGazCQFM6TnyoEEL8q0O6k3F7cvKT50i9Lj/8BHiMVOAgZvgBMPR6znDsaE2RrkrUFDqG/UMjvcvrIboTLmvWcFNHTitft/TACOzrZp3e2+zrIrMlKVXuXKhf8iItOQ1GJRMJLH4W2M+hQc+4gqADORbtpO9hAJHampNsYuUhJD/VBfTewCndAGP8bhTDV8MFN9JLroh1+EYmI/ypj94iMjsj2eii6iEuxoFbEJ06e7g==", "3e9ba237550d7d1c29b0fd6661b3fec27c5495504ae634252113128ff8e54a9e");
    $code = $decryptor->decrypt();
    eval($code);
}

?>

Function Calls

class_exists 1

Variables

None

Stats

MD5 26223386ac5b3b9bd8b25d698a0a05d2
Eval Count 0
Decode Time 50 ms