Home  >  Article  >  Backend Development  >  DES encryption and decryption php code sharing

DES encryption and decryption php code sharing

黄舟
黄舟Original
2017-08-21 09:47:081867browse

Share a DES encryption and decryption PHP class, obtain the physical address, encrypt the plain text information, decrypt the cipher text, save the cipher text to a file, obtain the MAC address of the server, execute the ipconfig command under the windows server, Linux Execute the ifconfig command on the server.

First step: Download the DES encryption and decryption PHP class library we need to use in this lesson: http://www.php.cn/xiazai/leiku/673

Step 2: After the download is completed, find the php class file, extract it to the local server, and create a new php file!

Step 3: We call this class in this new file and instantiate this class:

<?php
include_once "code3.php"; //引入类文件
$code=new authCode();     //实例化
//加密
$code->encode("~!@#$%^");
//解密
echo $code->decode("~!@#$%^");
?>


The running results are as shown below:

DES encryption and decryption php code sharing#

The above is the detailed content of DES encryption and decryption php code sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP hash table principleNext article:PHP hash table principle