DES stands for Data Encryption Standard, which is a block algorithm that uses key encryption. In 1977, it was determined as a Federal Information Processing Standard (FIPS) by the National Bureau of Standards of the U.S. federal government and authorized to be used in Africa. Used in classified government communications, the algorithm subsequently became widely circulated internationally. It should be noted that in some literature, DES as an algorithm is called Data Encryption Algorithm (DEA), which has been distinguished from DES as a standard.
This article mainly introduces the DES encryption and decryption method implemented by PHP, and analyzes the related techniques of DES encryption and decryption by PHP in the form of a complete example. Friends in need can refer to, the details are as follows:
'; echo 'str:' . $str . '
'; $jiami = jiami($key, $str); echo '加密:' . $jiami . '
'; file_put_contents('jiamiqian.txt', $str); file_put_contents('jiamihou.txt', $jiami); $jiemi = jiemi($key, $jiami); echo '解密:' . $jiemi . '
';
The above is the detailed content of php des encryption and decryption code. For more information, please follow other related articles on the PHP Chinese website!