www.webdeveloper.com
Results 1 to 4 of 4

Thread: Decypt class encypt, please!

  1. #1

    Thumbs up Decypt class encypt, please!

    I have lass encrypt, but i can not decrypt. I have tried many ways but have not been . People to help me with this class decypt, please!
    PHP Code:
    <?php
    /*==========================
    *    Example use encode :
    *    <?
    *    include('encode.php');
    *    $encode = new encode();
    *    $encryptText = $encode->encrypt('content','yourkey');
    *    echo $encryptText;
    *    ?>
    ===========================*/
    class encode{
        private 
    $rda;
        private 
    $sof;
        private 
    $Mf;
        private 
    $Yv;
        private 
    $Ki;
        private 
    $Dol = array(0x010x020x040x080x100x20,0x400x800x1b0x360x6c0xd8,0xab0x4d0x9a0x2f0x5e0xbc,0x630xc60x970x350x6a0xd4,0xb30x7d0xfa0xef0xc50x91);
        private 
    $Qre = array(991241191232421071111974811034325421517111820213020112525089712401732121621751561641141921832531473854632472045216522924111321649214199351952415051547181282262353917811791314426271109016082592141794122747132,  8320902373225217791106203190577476882072082391702516777511336924921278060159168811636414314615756245188182218331625524321020512192369515168231961671266110093251159612979220344214413670238184202229411219224505810736369219421117298145149228121231200551091412137816910886244234101122174818612037462816618019823222111631751891391381126218110272324614975387185134193291582252481521710521714214815530135233206854022314016113713191230661046515345151768418722);
        private 
    $blz 128;
        private 
    $szj 192;
        public function 
    __construct(){
            
    $this->rda = array(0,0,0,0,array(0,0,0,0,10,0,12,0,14),0,array(0,0,0,0,12,0,12,0,14),0,array(0,0,0,0,14,0,14,0,14));
            
    $this->sof = array(0,0,0,0,array(0,1,2,3),0,array(0,1,2,3),0,array(0,1,3,4));
            
    $this->Ki $this->blz/32;
            
    $this->Yv $this->szj/32;
            
    $this->Mf $this->rda[$this->Yv][$this->Ki];
        }
        public function 
    encrypt($src,$key){
            
    $ct = array();
            
    $bla = array();
            
    $igb $this->blz/8;
            
    $chars $this->kghfyu($this->stohca($src));
            
    $epy $this->kips($this->stohca($key));
            for(
    $i=0;$i<count($chars)/$igb;$i++){
                
    $bla $this->sbugj($chars,$i*$igb,($i+1)*$igb);
                
    $bla $this->ectghugp($bla,$epy);
                
    $ct $this->ghctqart($ct,$bla);
            }
            return 
    $this->chrtoh($ct);
        }
        private function 
    chrtoh($chars){
            
    $result "";
            
    $hexes = array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
            for(
    $i=0;$i<count($chars);$i++){
                
    $result .= $hexes[$chars[$i]>>4].$hexes[$chars[$i]&0xf];
            }
            return 
    $result;
        }
        private function 
    ectghugp($block,$epk){        
            
    $block $this->pagkbty($block);
            
    $block $this->rkddrhgntpk($block,$epk);
            for(
    $i=1;$i<$this->Mf;$i++){
                
    $block $this->greeftg($block,$this->sbugj($epk,$this->Ki*$i,$this->Ki*($i+1)));
            }
            
    $block $this->hfamyour($block,$this->sbugj($epk,$this->Ki*$this->Mf,count($epk)));
            
            return 
    $this->nyhgrfbyt($block);
        }
        private function 
    nyhgrfbyt($packed){
            
    $result = array();
            for(
    $j=0;$j<count($packed[0]);$j++){
                
    $result[count($result)] = $packed[0][$j];
                
    $result[count($result)] = $packed[1][$j];
                
    $result[count($result)] = $packed[2][$j];
                
    $result[count($result)] = $packed[3][$j];
            }
            return 
    $result;
        }
        private function 
    hfamyour($state,$rdv){
            
    $state $this->hjtyubgh($state);
            
    $state $this->srhfjugh($state);
            
    $state $this->rkddrhgntpk($state,$rdv);
            return 
    $state;
        }
        private function 
    greeftg($state,$rdv){
            
    $state $this->hjtyubgh($state);
            
    $state $this->srhfjugh($state);
            
    $state $this->gydftcoph($state);
            
    $state $this->rkddrhgntpk($state,$rdv);
            return 
    $state;
        }
        private function 
    gydftcoph($state){
            
    $b = array();
            for(
    $j=0;$j<$this->Ki;$j++){
                for(
    $i=0;$i<4;$i++){
                    
    $b[$i] = $this->myhdgrttuk($state[$i][$j],2) ^ $this->myhdgrttuk($state[($i+1)%4][$j],3) ^ $state[($i+2)%4][$j] ^ $state[($i+3)%4][$j];
                }
                for(
    $i=0;$i<4;$i++){
                    
    $state[$i][$j] = $b[$i];
                }
            }
            return 
    $state;
        }
        private function 
    myhdgrttuk($x,$y){
            
    $result 0;
            for(
    $bit=1;$bit<256;$bit*=2,$y=$this->rthymk($y)){
                if(
    $x&$bit){$result ^= $y;}
            }
            return 
    $result;
        }
        private function 
    rthymk($poly){
            
    $poly<<=1;
            return ((
    $poly&0x100)?($poly^0x11B):($poly));
        }
        private function 
    srhfjugh($state){
            for(
    $i=1;$i<4;$i++){
                
    $state[$i] = $this->rdthgbnjywss($state[$i],$this->sof[$this->Ki][$i]);
            }
            return 
    $state;
        }
        private function 
    rdthgbnjywss($src,$pos){
            
    $temp $this->sbugj($src,0,$pos);
            
    $src $this->sbugj($src,$pos,count($src));
            
    $src $this->ghctqart($src,$temp);
            return 
    $src;
        }
        private function 
    hjtyubgh($state){
            
    $S $this->Qre;
            for(
    $i=0;$i<4;$i++){
                for(
    $j=0;$j<$this->Ki;$j++){
                    
    $state[$i][$j] = $S[$state[$i][$j]];
                }
            }
            return 
    $state;
        }
        private function 
    rkddrhgntpk($state,$rdv){
            for(
    $j=0;$j<$this->Ki;$j++){
                
    $state[0][$j] ^= ($rdv[$j]&0xFF);
                
    $state[1][$j] ^= (($rdv[$j]>>8)&0xFF);
                
    $state[2][$j] ^= (($rdv[$j]>>16)&0xFF);
                
    $state[3][$j] ^= (($rdv[$j]>>24)&0xFF);
            }
            return 
    $state;
        }
        private function 
    pagkbty($octets){
            
    $state = array();
            
    $state[0] = array();
            
    $state[1] = array();
            
    $state[2] = array();
            
    $state[3] = array();
            for(
    $j=0;$j<count($octets);$j+=4){
                
    $state[0][$j/4] = $octets[$j];
                
    $state[1][$j/4] = $octets[$j+1];
                
    $state[2][$j/4] = $octets[$j+2];
                
    $state[3][$j/4] = $octets[$j+3];
            }
            return 
    $state;
        }
        private function 
    kips($key){
            
    $temp 0;
            
    $this->Yv $this->szj/32;
            
    $this->Ki $this->blz/32;
            
    $epk = array();
            
    $this->Mf $this->rda[$this->Yv][$this->Ki];
            for(
    $j=0;$j<$this->Yv;$j++){
                
    $epk[$j] = ($key[4*$j]) | ($key[4*$j+1]<<8) | ($key[4*$j+2]<<16) | ($key[4*$j+3]<<24);
            }
            for(
    $j=$this->Yv;$j<$this->Ki*($this->Mf+1);$j++){
                
    $temp $epk[$j-1];
                if(
    $j%$this->Yv==0){
                    
    $temp = (($this->Qre[($temp>>8)&0xFF]) | ($this->Qre[($temp>>16)&0xFF]<<8) | ($this->Qre[($temp>>24)&0xFF]<<16) | ($this->Qre[$temp&0xFF]<<24)) ^ $this->Dol[floor($j/$this->Yv)-1];
                }else if(
    $this->Yv>&& $j%$this->Yv==4){
                    
    $temp = ($this->Qre[($temp>>24)&0xFF]<<24) | ($this->Qre[($temp>>16)&0xFF]<<16) | ($this->Qre[($temp>>8)&0xFF]<<8) | ($this->Qre[$temp&0xFF]);
                }
                
    $epk[$j] = $epk[$j-$this->Yv]^$temp;
            }
            return 
    $epk;
        }
        private function 
    kghfyu($plaintext){
            
    $igb $this->blz/8;
            for(
    $i=$igb-(count($plaintext)%$igb);$i>&& $i<$igb;$i--){
                
    $plaintext[count($plaintext)] = 0;
            }
            return 
    $plaintext;
        }
        private function 
    stohca($str){
            
    $codes = array();
            for(
    $i=0;$i<strlen($str);$i++){
                
    $codes[$i] = $this->cgaftocdyhgtvb($str,$i);
            }
            return 
    $codes;
        }
        private function 
    ghctqart($arr1,$arr2){
            return 
    array_merge($arr1,$arr2);
        }
        private function 
    sbugj($arr,$b,$e){
            return 
    array_slice($arr,$b,$e-$b);
        }
        private function 
    cgaftocdyhgtvb($str,$index){
            
    $m ord(substr($str,$index,1));
            return 
    $m;
        }
    }
    ?>

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    888
    What???

  3. #3
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,506
    if you encode PHP file scripts to protect them, they can be decrypted and viewed.

    If you encrypt with a ZEND encoder, only the server knows what is in a file and it can not be decrypted.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  4. #4
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    888
    And? I still don't know what the less than verbose OP is asking.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles