little php help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fris
    I have to go potty
    • Aug 2002
    • 55844

    #1

    little php help

    Anyway to reverse this?

    Code:
    function hex2bin($data) {
         $len = strlen($data);
         return pack("H" . $len, $data); 
    } 
    
    function check_key($input){
        $iv = "qe3jigneqfrgnqw2egfmas4qetjkn5lg";
        $key = "589752d5b0f4217747bd721111be9057"; 
        $text = hex2bin($input);
        $domain = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
        echo $input. '<br/>' .$domain;
    }
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


    My Newest Theme
  • adultpro
    Registered User
    • Oct 2009
    • 28

    #2
    What do you mean by reverse? Are you talking about an algorithmic reversal or the possibility of reverse engineering?

    For an algorithmic reversal, the reverse would be taking the output contained in $domain, running it through mcrypt_encrypt() using the same key, IV, and mode, then running the output from that through a bin2hex function.

    As for reverse engineering, you have no worries about anything provided your key and IV are secure.
    Last edited by adultpro; 10-12-2009, 02:46 PM.

    Comment

    • quantum-x
      Confirmed User
      • Feb 2002
      • 6863

      #3
      PHP Code:
      <?
      
      function hex2bin($data) {
           $len = strlen($data);
           return pack("H" . $len, $data); 
      } 
      
      function bin2hex2($data) {
           return unpack("H*",$data);
      }
      
      function check_key($input){
          $iv = "qe3jigneqfrgnqw2egfmas4qetjkn5lg";
          $key = "589752d5b0f4217747bd721111be9057"; 
          $text = hex2bin($input);
          $domain = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
          return $domain;
      }
      
      function make_key($input)    {
          $iv = "qe3jigneqfrgnqw2egfmas4qetjkn5lg";
          $key = "589752d5b0f4217747bd721111be9057"; 
          $domain = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $input, MCRYPT_MODE_ECB, $iv);
          $key = bin2hex2($domain);
          return $key[1];
      }
      
      
      $key = make_key($_REQUEST['domain']);
      echo "Key is ".$key."<br /><br />\n\n";
      echo "Decode Check: ".check_key($key);
      
      
      ?>
      page.php?domain=test.com
      PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

      Comment

      Working...