search
HomeBackend DevelopmentPHP7Explain a high-performance, simple, cross-platform PHP7 code encryption extension

Explain a high-performance, simple, cross-platform PHP7 code encryption extension

Introduction

A simple, high-performance, cross-platform PHP7 code encryption extension
Source code address: GitHub

Recommended (free):PHP7

Features

  • Simple and fast, After actual testing, it has almost no impact on performance
  • Compatible with OPcache, Xdebug and other extensions
  • Supports Linux, macOS, Windows and other systems
  • Compatible with Apache, Nginx PHP-fpm, command line Waiting for running mode
  • The encryption algorithm is simpler, this is for speed considerations, but it is still difficult to decrypt
  • If the project has a lot of php files, you can only encrypt some important codes
  • Requires PHP >= 7.0

Installation

Please make the following modifications in core.h before compiling:

/* 这里定制你的加密特征头,不限长度,十六进制哦 */
const u_char tonyenc_header[] = {
        0x66, 0x88, 0xff, 0x4f,
        0x68, 0x86, 0x00, 0x56,
        0x11, 0x16, 0x16, 0x18,
};

/* 这里指定密钥,设置长一些更安全 */
const u_char tonyenc_key[] = {
        0x9f, 0x49, 0x52, 0x00,
        0x58, 0x9f, 0xff, 0x21,
        0x3e, 0xfe, 0xea, 0xfa,
        0xa6, 0x33, 0xf3, 0xc6,
};

Compile on Linux and macOS

git clone https://github.com/lihancong/tonyenc.git
cd tonyenc
phpize
./configure
make

Add the compiled file modules/tonyenc.so to the configuration item extension=tonyenc.so and restart the PHP service

Compile on Windows

The following modules have been compiled and are available for testing (requires VC14 runtime library):

# php7.0 64位 线程安全版
php_tonyenc_php70_ts_VC14_x64.dll
# php7.0 64位 线程非安全版
php_tonyenc_php70_nts_VC14_x64.dll

Manual compilation method

Encryption

tonyenc.php in the code is an encryption tool:

php tonyenc.php example.php dir/

This can encrypt all php files in the example.php and dir directories , PHP will automatically decrypt when running them, simple enough!

The above is the detailed content of Explain a high-performance, simple, cross-platform PHP7 code encryption extension. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:learnku. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)