newbtophp Posted July 10, 2009 Author Share Posted July 10, 2009 <?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 https://forums.phpfreaks.com/topic/164590-solved-result-wont-show/page/2/#findComment-873148 Share on other sites More sharing options...
MadTechie Posted July 10, 2009 Share Posted July 10, 2009 change htmlentities( $code ); to echo htmlentities( $code ); Link to comment https://forums.phpfreaks.com/topic/164590-solved-result-wont-show/page/2/#findComment-873214 Share on other sites More sharing options...
newbtophp Posted July 10, 2009 Author Share Posted July 10, 2009 change htmlentities( $code ); to echo htmlentities( $code ); Thanks that sorted it. Your awesome at this!! I'd recomend you. Link to comment https://forums.phpfreaks.com/topic/164590-solved-result-wont-show/page/2/#findComment-873221 Share on other sites More sharing options...
MadTechie Posted July 10, 2009 Share Posted July 10, 2009 I'm glade this is solved Link to comment https://forums.phpfreaks.com/topic/164590-solved-result-wont-show/page/2/#findComment-873227 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.