Skip to content

anonwins/phpx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PHPX - PHP File Encryption and Execution Utility

PHPX is a portable Windows utility for encrypting and executing PHP files. It provides a secure way to protect PHP source code while maintaining the ability to run encrypted scripts.

Features

  • File Encryption: Encrypt .php files to .phpx format using AES-256 encryption
  • File Decryption: Decrypt .phpx files back to readable PHP
  • Secure Execution: Run encrypted PHP files directly without exposing source code
  • File Associations: Automatic setup for .phpx file associations
  • Context Menus: Right-click encryption/decryption options for PHP and PHPX files
  • Interactive GUI: User-friendly menu system with file dialogs
  • Portable: No installation required - runs from any directory

Requirements

  • Windows 10/11
  • PowerShell 5.1 or later
  • PHP installed and available in PATH
  • Administrator privileges for installation (optional)

Building from Source

To build the executable from source:

  1. Ensure you have ps2exe installed:

    Install-Module -Name ps2exe
  2. Run the build script:

    cd src
    make.bat

This will create phpx.exe in the src directory with version information based on the current date.

After a successful build, you will be prompted to move the executable to the parent directory in order to use it via PATH.

Installation

  1. Download or clone this repository
  2. Build the executable using the build instructions above
  3. Run phpx.exe and select option 1 to install PHPX on your system
    • This sets up file associations for .phpx files
    • Adds context menu entries for encryption/decryption
    • Adds the PHPX directory to your system PATH

Test installation:

  • Run test.phpx (Encryption key: 123)

Usage

Double-click any .phpx file to execute it. You will be prompted for the decryption key.

Use the context menu to encrypt or decrypt files:

  • Right-click on .php files → "PHPX - Encrypt"
  • Right-click on .phpx files → "PHPX - Decrypt"

Making PHP Files Fully Compatible

Error codes:

  • If the PHP file exits with error code, PHPX will pause and wait for user input.
  • If you want the execution to pause on successful exit, use special error code 99. It will be treated as Success, but it will pause execution and wait for user input.

To ensure PHP files work correctly with PHPX:

  1. Ensure PHP is installed and accessible via the command line
  2. Test that your PHP scripts run normally with php script.php
  3. Ensure all required PHP extensions are installed
  4. Test encrypted scripts after encryption to verify functionality

Security and Encryption

  • Files are encrypted using AES-256 in CBC mode
  • Keys are padded/truncated to 32 bytes
  • Encrypted files are base64 encoded with custom character replacement
  • Temporary decrypted files are automatically deleted after execution
  • Use strong, unique encryption keys

License

[Add license information here]

Contributing

[Add contribution guidelines here]

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors