Home PHP Libraries Other libraries PHP encryption and decryption class
PHP encryption and decryption class
<?php
class crypt {
  private $skey;
  public function __construct($key) {
    $this->skey = hash("md5", $key, true); //32位skey
  }
  public function safe_b64encode($string) {
    $data = base64_encode($string);
    $data = str_replace(array('+', '/', '='), array('-', '_', ''), $data);
    return $data;
  }
  public function safe_b64decode($string) {
    $data = str_replace(array('-', '_'), array('+', '/'), $string);
    $mod4 = strlen($data) % 4;
    if ($mod4) {
      $data .= substr('====', $mod4);
    }
    return base64_decode($data);
  }

This is a PHP encryption and decryption class. Friends who need it can download and use it

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

Encryption and decryption PHP encryption and decryption class Encryption and decryption PHP encryption and decryption class

28 Jul 2016

Encryption and decryption: Encryption and decryption PHP encryption and decryption class: <?phpfunction i_array_column($input, $columnKey, $indexKey=null){ if(!function_exists('array_column')){ $columnKeyIsNumber = (is_numeric($columnKey))?true :false; $indexKeyIsNull

[php encryption and decryption class library] 10 php encryption and decryption class libraries download [php encryption and decryption class library] 10 php encryption and decryption class libraries download

15 May 2018

During the project development process, sometimes we need to use PHP to encrypt specific information, that is, to generate an encrypted string through the encryption algorithm. This encrypted string can be decrypted through the decryption algorithm to facilitate the program to process the decrypted information. deal with. The most common applications are in user login and some API data exchange scenarios.

PHP encryption and decryption class PHP encryption and decryption class

21 Jul 2016

PHP encryption and decryption class

php encryption and decryption processing class php encryption and decryption processing class

25 Jul 2016

php encryption and decryption processing class

Powerful PHP encryption and decryption class Powerful PHP encryption and decryption class

25 Jul 2016

Powerful PHP encryption and decryption class

PHP encryption and decryption class example analysis, encryption and decryption example analysis_PHP tutorial PHP encryption and decryption class example analysis, encryption and decryption example analysis_PHP tutorial

13 Jul 2016

PHP encryption and decryption class example analysis, encryption and decryption example analysis. PHP encryption and decryption class example analysis, encryption and decryption example analysis This article describes the PHP encryption and decryption class. Share it with everyone for your reference. The specific analysis is as follows: This code supports array addition

See all articles