Bash Script Encryption with SHC
This is a quick guide to protect your bash script from being viewed and modified by other people!
This method only protects your script from the so-called "skids" - people who don't really know what they are doing. If the person is somewhat knowledgable, he/she can still easily decrypt it and view the source.
Step 1: Install SHC
sudo add-apt-repository -y ppa:neurobin/ppa
sudo apt-get -y update
sudo apt-get -y install shc
On other Linux Distributions:
Step 2: Understand the tags
git clone https://github.com/neurobin/shc
sudo make install
-r: relaxed security
-U: untraceable binary
-H: hardened security
-s: run in a single process (requires the -H tag)
-e: expiration date (dd/mm/yyyy)
-m: expiration message
Step 3: Create a redistributable script
Generally, you would want to have the relaxed security so that the script to run on other Linux Operating System.
You can also add an expiration date:
shc -v -r -e 31/12/2019 -f script.sh
... and even expiration message:
shc -v -r -e 31/12/2019 -m "Script expired. Please contact TommyTran732" -f script.sh