Jump to content

[SOLVED] Result wont show


newbtophp

Recommended Posts

<?php

error_reporting(E_ALL);

?>

<form method="post" action="decoder.php" enctype="multipart/form-data">
<input type="file" name="data" value="Upload" /> 
<input type="submit" value="data" />
<br />
<?php

define("_ENCRYPTOR_KEY_", "cfcd208495d565ef66e7dff9f98764da");
define("_DECODER_PATH_", "decoder.php"); //You can change this path to point to the decoder file in another location.

if(file_exists(_DECODER_PATH_)){include_once(_DECODER_PATH_);}
else{echo"Decoder file does not exist";} // Relative or absolute path to the decoder file 




if (isset($_FILES['data'])) {
    $file = file_get_contents($_FILES['data']['tmp_name']);
   define("_ENCRYPTED_CODE_", $file);

    

    function decrypt( $key, $data )
    {
        return $this->endecrypt( $key, base64_decode( $data ), "decrypt" );
    }

    function encrypt( $key, $data )
    {
        return base64_encode( $this->endecrypt( $key, $data, "encrypt" ) );
    }
    
    if ( defined( "_ENCRYPTOR_KEY_" ) && defined( "_ENCRYPTED_CODE_" ) )
      {
       if ( strlen( _ENCRYPTOR_KEY_ ) == "32" )
       {
           $rc4 = new rc4crypt( );
           
           $code = $rc4->decrypt( _ENCRYPTOR_KEY_ .strrev( _ENCRYPTOR_KEY_ ), _ENCRYPTED_CODE_ );
           
           //as the _ENCRYPTED_CODE_  is invalid code i fixed it with the following code, this should be really br removed
           $code = substr( $rc4->decrypt( _ENCRYPTOR_KEY_ .strrev( _ENCRYPTOR_KEY_ ), _ENCRYPTED_CODE_ ),0,-7).'";';
           
           
           htmlentities( $code );
       }
       else
       {
           echo "Invalid key entered!";
       }
   }else{
       echo "Decoding error!";
   }
}


class rc4crypt {

   function decrypt( $key, $data )
    {
        return $this->endecrypt( $key, base64_decode( $data ), "decrypt" );
    }

    function encrypt( $key, $data )
    {
        return base64_encode( $this->endecrypt( $key, $data, "encrypt" ) );
    }

    
    function endecrypt ($pwd, $data, $case) {

        if ($case == 'decrypt') {

            $data = urldecode($data);

        }

        $key[] = "";
        $box[] = "";
        $temp_swap = "";
        $pwd_length = 0;

        $pwd_length = strlen($pwd);

        for ($i = 0; $i <= 255; $i++) {

            $key[$i] = ord(substr($pwd, ($i % $pwd_length), 1));
            $box[$i] = $i;

        }

        $x = 0;

        for ($i = 0; $i <= 255; $i++) {

            $x = ($x + $box[$i] + $key[$i]) % 256;
            $temp_swap = $box[$i];

            $box[$i] = $box[$x];
            $box[$x] = $temp_swap;

        }

        $temp = "";
        $k = "";

        $cipherby = "";
        $cipher = "";

        $a = 0;
        $j = 0;

        for ($i = 0; $i < strlen($data); $i++) {

            $a = ($a + 1) % 256;
            $j = ($j + $box[$a]) % 256;

            $temp = $box[$a];
            $box[$a] = $box[$j];

            $box[$j] = $temp;

            $k = $box[(($box[$a] + $box[$j]) % 256)];
            $cipherby = ord(substr($data, $i, 1)) ^ $k;

            $cipher .= chr($cipherby);

        }

        if ($case == 'decrypt') {

            $cipher = urldecode(urlencode($cipher));

        } else {

            $cipher = urlencode($cipher);

        }

        return $cipher;

    }
}
?>

 

Try testing on your localhost if it works then its probably someting wrong with my host.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.