00001 <?php 00026 if(!@include_once(ZIGROOT.DRS.Z_DIR_SEC.DRS.'mcrypt'.DRS.'mcpt.php')){ 00027 perror('Sorry cant Include '.ZIGROOT.DRS.Z_DIR_SEC.DRS.'mcrypt'.DRS.'mcpt.php'. 00028 "<br />from bth.php"); 00029 exit(1); 00030 } 00031 if(!@include_once(ZIGROOT.DRS.Z_DIR_SEC.DRS.'xor'.DRS.'xor.php')){ 00032 perror('Sorry cant Include '.ZIGROOT.DRS.Z_DIR_SEC.DRS.'xor'.DRS.'xor.php'. 00033 "<br />from bth.php"); 00034 exit(1); 00035 } 00036 00050 class zCryptDrv_both extends zCore { 00051 var $pt_mcpt; 00052 var $pt_xor; 00053 00054 function zCryptDrv_both(){ 00055 $this->__construct(); 00056 } 00057 function __construct(){ 00058 parent::__construct(); 00059 $this->pt_mcpt = new zCryptDrv_mcrypt(); 00060 $this->pt_xor = new zCryptDrv_xor(); 00061 } 00071 function encode(){ 00072 $list_args = func_get_args(); 00073 $str_xor = call_user_func_array(array(&$this->pt_xor, 'encrypt'), $list_args); 00074 if(isset($list_args[1]) && is_string($list_args[1])){ 00075 $str_mcpt = $this->pt_mcpt->encode($str_xor, $list_args[1]); 00076 }else{ 00077 $str_mcpt = $this->pt_mcpt->encode($str_xor); 00078 } 00079 return $str_mcpt; 00080 } 00089 function decode(){ 00090 $list_args = func_get_args(); 00091 if(isset($list_args[1]) && is_string($list_args[1])){ 00092 $list_args[0] = $this->pt_mcpt->decode($list_args[0], $list_args[1]); 00093 }else{ 00094 $list_args[0] = $this->pt_mcpt->decode($list_args[0]); 00095 } 00096 $str_xor = call_user_func_array(array(&$this->pt_xor, 'decrypt'), $list_args); 00097 return $str_xor; 00098 } 00111 function denc(){ 00112 $list_args = func_get_args(); 00113 $str_xor = call_user_func_array(array(&$this->pt_xor, 'encrypt'), $list_args); 00114 if(isset($list_args[1]) && is_string($list_args[1])){ 00115 $str_mcpt = $this->pt_mcpt->denc($str_xor, $list_args[1]); 00116 }else{ 00117 $str_mcpt = $this->pt_mcpt->denc($str_xor); 00118 } 00119 return $str_mcpt; 00120 } 00129 function ddcd(){ 00130 $list_args = func_get_args(); 00131 if(isset($list_args[1]) && is_string($list_args[1])){ 00132 $list_args[0] = $this->pt_mcpt->ddcd($list_args[0], $list_args[1]); 00133 }else{ 00134 $list_args[0] = $this->pt_mcpt->ddcd($list_args[0]); 00135 } 00136 $str_xor = call_user_func_array(array(&$this->pt_xor, 'decrypt'), $list_args); 00137 return $str_xor; 00138 } 00152 function tenc(){ 00153 $list_args = func_get_args(); 00154 $str_xor = call_user_func_array(array(&$this->pt_xor, 'encrypt'), $list_args); 00155 if(isset($list_args[1]) && is_string($list_args[1]) && !is_null($list_args[1])){ 00156 $str_mcpt = $this->pt_mcpt->tenc($str_xor, $list_args[1]); 00157 }else{ 00158 $str_mcpt = $this->pt_mcpt->tenc($str_xor); 00159 } 00160 return $str_mcpt; 00161 } 00170 function tdcd(){ 00171 $list_args = func_get_args(); 00172 if(isset($list_args[1]) && is_string($list_args[1]) && !is_null($list_args[1])){ 00173 $list_args[0] = $this->pt_mcpt->tdcd($list_args[0], $list_args[1]); 00174 }else{ 00175 $list_args[0] = $this->pt_mcpt->tdcd($list_args[0]); 00176 } 00177 $str_xor = call_user_func_array(array(&$this->pt_xor, 'decrypt'), $list_args); 00178 return $str_xor; 00179 } 00188 function encrypt(){ 00189 $list_args = func_get_args(); 00190 return call_user_func_array(array(&$this, 'encode'), $list_args); 00191 } 00200 function decrypt(){ 00201 $list_args = func_get_args(); 00202 return call_user_func_array(array(&$this, 'decode'), $list_args); 00203 } 00204 } 00206 ?>