Coder Social home page Coder Social logo

66hh / screw-opcode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from del-xiong/screw-opcode

0.0 0.0 0.0 2.35 MB

基于opcache魔改进行php加密,在生成和读取opcode阶段进行加解密从而有效防止源码泄露。

Shell 0.33% C 98.63% Go 0.25% M4 0.79%

screw-opcode's Introduction

screw_opcode

基于opcache魔改进行php加密,在生成和读取opcode阶段进行加解密从而有效防止源码泄露。

已支持php版本
php 7.2(master版本)
php8.0 php-8.0分支 (https://github.com/del-xiong/screw-opcode/tree/php-8.0)

安装

编译流程

  1. 下载本程序并解压到某个目录并进入
  2. 执行 bash gensecretkey.sh 生成随机安全密钥头文件
  3. 执行php bin中的phpize自动生成扩展所需文件(如果你的php里没有可以去官网下载)
  4. 执行 ./configure --with-php-config=[php config path] 进行配置,[php config path]是你的php-config的绝对路径
  5. 执行make生成扩展 modules/screwopcode.so
  6. make install安装扩展或手动把扩展路径加入php.ini中 重启php
注意由于是zend插件,需要用zend_extension来载入
zend_extension=/path/to/screwopcode.so
  1. 新建opcode缓存目录(假设为/tmp/opcodes)并修改php.ini配置文件,添加以下配置
[screwopcode]
screwopcode.enable = 1
screwopcode.file_cache=/tmp/opcodes
screwopcode.file_cache_only=0
screwopcode.file_override_enabled=0
screwopcode.enable_cli=1
screwopcode.jit=0
screwopcode.validate_timestamps=0
  1. 执行php -m 确认[Zend Modules]中包含ScrewOpcode说开插件加载成功

/tmp/opcodes 是opcode加密缓存目录 可以自定义到其他目录,必须先创建目录否则可能出错

如何使用

插件安装成功后,运行php的时候会自动生成opcode缓存并移除源代码,下次执行相同文件直接从opcode加载。 你也可以在项目发布前使用小工具手动批量加密,进入xmder目录并执行 ./xmder -p [你的源码目录] 即可(目前还未添加并发处理所以速度可能会比较慢)

项目持续升级中 企鹅群 530887505

screw-opcode's People

Contributors

del-xiong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.