Помогите разобрать PHP скрипт

Discussion in 'Болталка' started by Somersbee, 22 Jun 2014.

  1. Somersbee

    Somersbee New Member

    Joined:
    15 Apr 2012
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    В php не особо силен, единственное что понял, что функция криптует текст/пасс особым рандомным образом
    Вопрос в том, можно ли такой расшифровать, зная алгоритм криптовки?

    PHP:
    function num_two_way_encript($str$desc false$spliter "/"){
        if(
    $str != ""){
            
    $key = array();
            
    $key[0] = str_split("qETUoadgjl");
            
    $key[1] = str_split("plIJgyRDaw");
            
    $key[2] = str_split("MNbqwEASdL");
            
    $key[3] = str_split("PQOWieuryt");
            
    $key[4] = str_split("PLMOKIJnub");
            
    $key[5] = str_split("xcvbnMKJHG");
            
    $key[6] = str_split("oDGHJKqwua");
            
    $key[7] = str_split("hajskdLFOp");
            
    $key[8] = str_split("qmhdGTYUIO");
            
    $key[9] = str_split("ZOiuaSDFYe");
            
    $randkey[0] = str_split("PiyTrqasVm");
            
    $randkey[1] = str_split("SDFuytQWEm");
            
    $randkey[2] = str_split("HgFdIOPqwA");
            
    $randkey[3] = str_split("YHNujmKIOb");
            
    $randkey[4] = str_split("CVDFERtyui");
            
    $randkey[5] = str_split("WDCwsxQAZg");
            
    $randkey[6] = str_split("Aokmijngtr");
            
    $randkey[7] = str_split("adlkQWPOtr");
            
    $randkey[8] = str_split("BVCXZnmlOP");
            
    $randkey[9] = str_split("SFHKLWbnUI");
            if(
    $desc){
                
    $parts explode(".",($str));
                
    $x=0;
                foreach(
    $randkey[0] as $rk){if($rk == $parts[2]){$rand2 $x; break;}$x++;}
                
    $x=0;
                foreach(
    $randkey[$rand2] as $rk){if($rk == $parts[1]){$rand $x; break;}$x++;}
                
    $str $parts[0];
                
    $str str_replace($key[$rand][0],"1",$str);    
                
    $str str_replace($key[$rand][1],"2",$str);    
                
    $str str_replace($key[$rand][2],"3",$str);    
                
    $str str_replace($key[$rand][3],"4",$str);    
                
    $str str_replace($key[$rand][4],"5",$str);    
                
    $str str_replace($key[$rand][5],"6",$str);    
                
    $str str_replace($key[$rand][6],"7",$str);    
                
    $str str_replace($key[$rand][7],"8",$str);    
                
    $str str_replace($key[$rand][8],"9",$str);    
                
    $str str_replace($key[$rand][9],"0",$str);
                return 
    strrev($str);
            }else{
                
    $rand mt_rand(0,9);
                
    $rand2 mt_rand(0,9);
                
    $str strrev($str);
                
    $str str_replace("1",$key[$rand][0],$str);    
                
    $str str_replace("2",$key[$rand][1],$str);    
                
    $str str_replace("3",$key[$rand][2],$str);    
                
    $str str_replace("4",$key[$rand][3],$str);    
                
    $str str_replace("5",$key[$rand][4],$str);    
                
    $str str_replace("6",$key[$rand][5],$str);    
                
    $str str_replace("7",$key[$rand][6],$str);    
                
    $str str_replace("8",$key[$rand][7],$str);    
                
    $str str_replace("9",$key[$rand][8],$str);    
                
    $str str_replace("0",$key[$rand][9],$str);        
                return (
    $str.".".$randkey[$rand2][$rand].".".$randkey[0][$rand2]);
            }    
        }
    }

    function 
    encript_data($pass){
        
    $original md5($pass);
        
    $original str_replace("7","v5c8",$original);
        
    $original str_replace("c","m9f1",$original);
        
    $original str_replace("f","xj3",$original);
        
    $l strlen($original);
        
    $key str_replace("0","wr2",substr($original,0,$l -20));
        
    $key2 str_replace("b","prlat7",substr($original,2,$l -15));
        
    $original $key2.$key;
        return 
    md5($original);
    }


    function 
    two_way_encript($str$desc false){
        if(!
    $desc){
            
    $result bin2hex($str);
            
    $result str_replace("d","yxAx",$result);
            
    $result str_replace("1","XxAx",$result);
            
    $result str_replace("7","pxAx",$result);
            
    $result str_replace("3","SxAx",$result);
        }
        else{
            
    $str str_replace("yxAx","d",$str);
            
    $str str_replace("XxAx","1",$str);
            
    $str str_replace("pxAx","7",$str);
            
    $str str_replace("SxAx","3",$str);
            
    $result hextostr($str);
        }
        return 
    $result;
    }
    function 
    sbo_two_way($str$desc false){
        if(!
    $desc){
            
    $result bin2hex($str);
            
    $result str_replace("d","y",$result);
            
    $result str_replace("1","X",$result);
            
    $result str_replace("7","p",$result);
            
    $result str_replace("3","S",$result);
        }
        else{
            
    $str str_replace("y","d",$str);
            
    $str str_replace("X","1",$str);
            
    $str str_replace("p","7",$str);
            
    $str str_replace("S","3",$str);
            
    $result hextostr($str);
        }
        return 
    $result;
    }  
     
    #1 Somersbee, 22 Jun 2014
    Last edited: 22 Jun 2014