Code Monkey home page Code Monkey logo

php_obfuscator's Introduction

PHP obfuscator

php 8.2

banner

The Minify.php script will remove all the page setup of an existing PHP source code i.e. remove comments, unneeded carriage returns, multiples spaces, ...

Then, once minified, the script will obfuscate your code based on your settings.

Obfuscation

Take a look on the src/settings.json, it looks like:

{
    "replace": {
        "$commentTokens": "$n",
        "$compress": "$xZ0",
        "$content": "$c",
        "removeComments": "rmCts"
    }
}

The replace array contains a list of keys (like $commentTokens) and a list of values (like $n).

You should define there the list of everything you want to obfuscate like the name of your class, name of your functions or variables.

In the example provided above, every occurrences of $commentTokens in the source file will be replaced by $n and this will be done for each keys.

How to run

The minify script requires two arguments, the name of the input file and the name of the name of the resulting, output, file.

php Minify.php input=src/Minify.php output=samples/test.php

The command line above will process the [src/Minify.php](https://github.com/cavo789/php_obfuscator/blob/main/src/minify.php), keep that file unmodified but read his content, minify and obfuscate it and create then the https://github.com/cavo789/php_obfuscator/blob/main/samples/test.php file.

Sample

The file samples/test.php has been created by running this command: php Minify.php input=src/Minify.php output=samples/test.php.

The original file is src/Minify.php.

Why

I've created this script years ago (in 2013) when I've started to develop and sell a web application firewall.

This software took me several hundred hours and, at the time, I wanted to secure my work and make it as difficult as possible for a dishonest person to appropriate my work and sell it on their behalf.

Making the code unreadable seemed like a good solution at the time.

Author

Christophe Avonture

php_obfuscator's People

Contributors

cavo789 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.