Public Member Functions | |
zCryptDrv_both () | |
__construct () | |
encode () | |
First encodes with zCryptDrv_xor::encode() and again encodes the result with zCryptDrv_mcrypt::encode(). | |
decode () | |
decodes a string encoded using zCryptDrv_both::encode() | |
denc () | |
multi layer encryption using dynamic IV. | |
ddcd () | |
Decrypts a string encoded using denc(). | |
tenc () | |
multi layer time Based encryption. | |
tdcd () | |
Decrypts a string encoded using tenc(). | |
encrypt () | |
alias of encode() | |
decrypt () | |
alias of decode(). | |
Data Fields | |
$pt_mcpt | |
$pt_xor |
First encrypts with XOR then with mcrypt If this class is used for encryption for encryption decryption Both of the XOR and mcrypt is used for encryption . recomended if you want strong Encryption.
The following applies to all the methods of this Class.
By default uses the encryption key set on the Configuration files. However you can supply another one through the second optional argument. e.g. In all the cases key/password is optional.
Definition at line 50 of file bth.php.
zCryptDrv_both::__construct | ( | ) |
Reimplemented from zCore.
Definition at line 57 of file bth.php.
Referenced by zCryptDrv_both().
00057 { 00058 parent::__construct(); 00059 $this->pt_mcpt = new zCryptDrv_mcrypt(); 00060 $this->pt_xor = new zCryptDrv_xor(); 00061 }
zCryptDrv_both::zCryptDrv_both | ( | ) |
Definition at line 54 of file bth.php.
References __construct().
00054 { 00055 $this->__construct(); 00056 }
zCryptDrv_both::encode | ( | ) |
First encodes with zCryptDrv_xor::encode() and again encodes the result with zCryptDrv_mcrypt::encode().
$str | string string to encode. | |
$key | string optionally you can specify a key/password with which to encrypt. |
Definition at line 71 of file bth.php.
00071 { 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 }
zCryptDrv_both::decode | ( | ) |
decodes a string encoded using zCryptDrv_both::encode()
$str | string string to decode. | |
$key | string optionally you can specify a key/password with which to decrypt. |
Definition at line 89 of file bth.php.
00089 { 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 }
zCryptDrv_both::denc | ( | ) |
multi layer encryption using dynamic IV.
First encodes with zCryptDrv_xor::encode() and again encodes the result with zCryptDrv_mcrypt::denc(). First encrypts using XOR adapter and then encrypts using mcrypt with dynamic IV.
$str | string string to encode. | |
$key | string optionally you can specify a key/password with which to encrypt. |
Definition at line 111 of file bth.php.
00111 { 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 }
zCryptDrv_both::ddcd | ( | ) |
Decrypts a string encoded using denc().
$str | string string to decode. | |
$key | string optionally you can specify a key/password with which to decrypt. |
Definition at line 129 of file bth.php.
00129 { 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 }
zCryptDrv_both::tenc | ( | ) |
multi layer time Based encryption.
First encodes with zCryptDrv_xor::encode() and again encodes the result with zCryptDrv_mcrypt::tenc(). First encrypts using XOR adapter and then encrypts using mcrypt with key concated with time. so that an encrypted string is vaid only for a second or a microsecond.
$str | string string to encode. | |
$key | string optionally you can specify a key/password with which to encrypt. |
Definition at line 152 of file bth.php.
00152 { 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 }
zCryptDrv_both::tdcd | ( | ) |
Decrypts a string encoded using tenc().
$str | string string to decode. | |
$key | string optionally you can specify a key/password with which to decrypt. |
Definition at line 170 of file bth.php.
00170 { 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 }
zCryptDrv_both::encrypt | ( | ) |
alias of encode()
$str | string string to encode. | |
$key | string optionally you can specify a key/password with which to encrypt. |
Definition at line 188 of file bth.php.
00188 { 00189 $list_args = func_get_args(); 00190 return call_user_func_array(array(&$this, 'encode'), $list_args); 00191 }
zCryptDrv_both::decrypt | ( | ) |
alias of decode().
$str | string string to decode. | |
$key | string optionally you can specify a key/password with which to decrypt. |
Definition at line 200 of file bth.php.
00200 { 00201 $list_args = func_get_args(); 00202 return call_user_func_array(array(&$this, 'decode'), $list_args); 00203 }