Add symbol scrambling to PHP encrypted execution#2
Merged
archisgore merged 3 commits intomainfrom Jan 23, 2026
Merged
Conversation
Add comprehensive symbol scrambling to the encrypted execution PHP
scrambler, extending beyond keyword scrambling to include structural
symbols like braces, brackets, parentheses, semicolons, and operators.
Changes:
- Expanded symbolChars array to include {}, [], (), ;, and operators
- Enhanced permutationGen to avoid problematic symbol mappings
- Updated TOKENS pattern in lex file to include new symbols
- Implemented two-pass transformation in transform-php.py:
* Pass 1: Transform keywords with word boundaries
* Pass 2: Transform symbols (excluding those in strings)
- Enabled symbol scrambling by default with --chars flag
- Added comprehensive local testing infrastructure
Testing:
- Created Dockerfile.test-symbols for isolated testing
- Created test scripts for validation
- Verified symbol transformations work correctly
- Confirmed symbols in strings are preserved
Results show successful scrambling of:
- Braces: { → ; and } → -
- Parentheses: ( → ^ and ) → ,
- Brackets: [ → { and ] → :
- Semicolons: ; → )
- And other operators
This makes PHP code structure significantly more obfuscated while
maintaining functionality. PEAR compatibility and full integration
testing are pending.
NOT PUSHED TO GITHUB - LOCAL BRANCH ONLY
Adds GitHub Actions workflow that runs on pull requests to validate changes before merging to main. This ensures symbol scrambling and other changes are tested in CI before merge. Includes: - Build validation for tools and main image - Test suite execution - Symbol scrambling tests (if scrambler changes detected)
- Remove non-existent tools image build - Simplify to just build and test main PHP image - Use correct working directories - Add timeout limits - Test symbol scrambling if Dockerfile exists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symbol Scrambling Implementation
This PR extends the PHP encrypted execution scrambler to include symbol scrambling in addition to keyword scrambling, significantly increasing code obfuscation.
Features
Expanded Symbol Set
(,),[,],{,};,,,:-,+,=,%,~,^,&,|,!,@Smart Transformation
(→)or{→}Changes
Core Files
dictionaryHandler.go: Expanded symbol set and enhanced permutation safetyscrambler.go: Updated TOKENS pattern for new symbolstransform-php.py: Two-pass transformation with string-aware symbol replacementrun-scrambler.sh: Enabled symbol scrambling by defaultTesting
Dockerfile.test-symbols: Isolated testing environmenttest-symbol-scrambling-docker.sh: Comprehensive validation scriptSYMBOL_SCRAMBLING.md: Full documentationTest Results
Successfully transforms PHP symbols:
Example
Before:
After:
NlMIKXpLIF TestClass ; jupqoZ gctYobNePm calculate^$a! $b, ; EqCVEUrH $a | $b) - -Impact
Testing Checklist
Please review and merge if CI passes.