Bash Script Encryption

  • Views Views: 186
  • Last updated Last updated:
  • Bash Script Encryption with SHC

    This is a quick guide to protect your bash script from being viewed and modified by other people!

    Note: 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

    On Ubuntu:
    sudo add-apt-repository -y ppa:neurobin/ppa
    sudo apt-get -y update
    sudo apt-get -y install shc
    On other Linux Distributions:
    git clone
    cd shc
    sudo make install

    Step 2: Understand the tags

    -v: verbose
    -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.
    shc -v -r -f
    You can also add an expiration date:
    shc -v -r -e 31/12/2019 -f
    ... and even expiration message:
    shc -v -r -e 31/12/2019 -m "Script expired. Please contact TommyTran732" -f
  • Loading…