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));
}
![image.png](https://static.studygolang.com/220225/6b8ee6b6a0e5ca06df2e143fccd200a8.png)
#3