As encoding becomes a regular part of your development cycle, you may start to wonder how you can automate the process and make it part of your continuous delivery model. The following article was contributed by Hendrik Prinsloo of Clevva who uses ionCube as part of their CI process.
How to introduce code obfuscation in your continuous delivery model
Please note: This article is about a potential way of making code obfuscation part of your continuous delivery model; it is not about whether the concept is viable or not.
As a release manager or developer I would like to have the source code encoded when a new version is released without having to do it manually.
We used to have a machine in our office dedicated to run the ionCube software. Whenever a new version was released, someone had to manually execute a step-by-step sequence to create an encoded version thereof. The ionCube software allows you to do it very easily. However, if you have to do this frequently, the repetitive nature of it would drive you insane.
It was during this insanity that we decided to automate it. The idea is very simple: move it to a cloud server and trigger it remotely. This extended into adopting it in our deployment pipeline, making it completely automated.
The developer pushes a tag (or a branch) to the remote repository. Bitbucket’s pipelines catches the new tag (or updated branch) and executes a script. This script connects to the remote machine via ssh and executes the ionCube Encoder.
- Guaranteed compatibility of source code against the version of PHP
- Reverse engineering attempts require more effort
- Mitigate license manipulation/abuse
- Setup time
- Adds some time to your CD (depends on the size of your project)
Step-by-step walkthrough to help you get started. You should be able to adapt this into your CI/CD flow regardless of what technology you are using.
- Sign up for the ionCube Encoder trial and copy the download link (it will be emailed to your inbox)
- Set up public key authentication to the remote server
1. Copy git repo on local machine
git clone email@example.com:HendrikPrinsZA/ssh-ioncube.git &&
2. Copy git repo on remote machine
git clone firstname.lastname@example.org:HendrikPrinsZA/ssh-ioncube.git && cd
3. Install ionCube PHP Encoder on remote machine
tar -zxvf ioncube_encoder_evaluation.tar.gz
4. Trigger encoding from local machine
./local.sh –host=”devops.example.com” \