Home > Backend Development > PHP Tutorial > PHP implementation of Des encryption algorithm

PHP implementation of Des encryption algorithm

WBOY
Release: 2016-07-25 09:12:40
Original
1284 people have browsed it

We don’t want some data to be seen by others, so we want to replace it with other strings or numbers, disguised as unrecognizable sentences

This is just an encryption operation for one or several pieces of data.

Let’s take a look at this code now. No need to introduce a class library, simple implementation:

  1. //Encryption and decryption
  2. $id = base64_encode('99999');
  3. $name= base64_encode('ming');
  4. $deid = base64_decode($id);
  5. $dename= base64_decode($name);
  6. echo $id.'----'.$deid;
  7. echo '
    ';
  8. echo $name. '----'.$dename;
  9. Result: OTk5OTk=----99999
  10. bWluZw==----ming
Copy code



Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template