JAVA DES encryption class, how to use PHP to achieve encryption, decryption

1, JAVA DES encryption class, how to use PHP to achieve encryption, decryption.
(1) encryption
if the key is 123mursharpAbcd, the plaintext is hello world, output 3d518daea941120d72fe3488f5d27a64
under this code, it will appear before data decryption is 87897DDA5754EAAE69E7F063E8B0962A, the plaintext is {"retcode": "2"}
code is as follows

/**
 * DES
 * @param string  $data   
 * @param string  $key    (64bit-->8byte; 128bit-->16byte; 256bit-->32byte)
 * @param string  $iv     , : 0123456789123456
 * @return string   
 */
function des_encrypt($data, $key, $iv="", $padding="\0") {
    $blocksize = 16;
    $pad = $blocksize - (strlen($data) % $blocksize);       //
    $data = $data . str_repeat($padding, $pad);     //\0
    return bin2hex(mcrypt_encrypt(MCRYPT_DES, $key, $data, MCRYPT_MODE_ECB, $iv));
}

/**
 * DES
 * @param string  $data   
 * @param string  $key    (64bit-->8byte; 128bit-->16byte; 256bit-->32byte)
 * @param string  $iv     , : 0123456789123456
 * @return string   
 */
function des_decrypt($data, $key, $iv="", $padding="\0") {
    //, 
    return rtrim(mcrypt_decrypt(MCRYPT_DES, $key, hex2bin($data), MCRYPT_MODE_ECB, $iv), $padding);
}
echo des_encrypt("hello world", "123-sharpAbcd")."</br>";
Mar.04,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a9fd-2c236.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a9fd-2c236.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?