Public Member Functions | |
zCryptObj () | |
__construct () | |
small_enc ($string) | |
Zigmoyd's Internal function. | |
small_dcd ($string) | |
Zigmoyd's Internal function. | |
Data Fields | |
$skey |
Definition at line 76 of file sec.php.
zCryptObj::__construct | ( | ) |
Definition at line 82 of file sec.php.
Referenced by zCryptObj().
00082 { 00083 parent::__construct(); 00084 $tmp_ini_key = parse_ini_file(ZIGROOT.DRS.Z_DIR_PROJECTS.DRS.Z_PROJECT_DIR.DRS.ZIGSETTINGSDIR.DRS.'zcpt.ini.php', false); 00085 $this->skey = $tmp_ini_key['key']; 00086 }
zCryptObj::zCryptObj | ( | ) |
Definition at line 79 of file sec.php.
References __construct().
00079 { 00080 $this->__construct(); 00081 }
zCryptObj::small_enc | ( | $ | string | ) |
Zigmoyd's Internal function.
For internal use only.
$string | string |
Definition at line 94 of file sec.php.
Referenced by small_dcd().
00094 { 00095 $key = $this->skey; 00096 for($i=0; $i<=strlen($string)-1; $i++){ 00097 for($j=0; $j<=strlen($key)-1; $j++){ 00098 $string[$i] = $string[$i]^$key[$j]; 00099 } 00100 if($i != 0 && $i != strlen($string)-1){ 00101 $string[$i] = $string[$i]^$string[$i-1]^$string[$i+1]; 00102 } 00103 } 00104 return $string; 00105 }
zCryptObj::small_dcd | ( | $ | string | ) |
Zigmoyd's Internal function.
For internal use only.
$string | string |
Definition at line 113 of file sec.php.
References small_enc().
00113 { 00114 $key = $this->skey; 00115 for($i=strlen($string)-1; $i>=0; $i--){ 00116 if($i == 0 || $i == strlen($string)-1){ 00117 for($j=0; $j<=strlen($key)-1; $j++){ 00118 $string[$i] = $string[$i]^$key[$j]; 00119 } 00120 }else{ 00121 $string[$i] = $this->small_enc($string[$i], $key)^$string[$i-1]^$string[$i+1]; 00122 } 00123 } 00124 return (int)$string; 00125 }