public function encrypt($input,$key){
$size = mcrypt_get_block_size (MCRYPT_3DES, MCRYPT_MODE_ECB );
$input = $this->pkcs7_pad($input, $size);
$key = base64_decode($key);
$td = @mcrypt_module_open(MCRYPT_3DES, '', MCRYPT_MODE_ECB, '');
@mcrypt_generic_init($td, $key,'');
$data = mcrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
return strtoupper(bin2hex($data));
}