I am not a big fan of shell script encryption as I can not audit script that needs to be run as root. However, there might be some examples where you need to encrypt your bash shell script.
From the blog post:
If you want to encrypt your bash script for some reason, you can do that with SHC utility. Encrypting your script with SHC provides you with a basic type of protection. Please note that the encrypted shell script created by shc is not readable by a regular users but a skilled user can extract the original shell script from the encrypted binary. General rule is to avoid shell script encryption and use better solutions for your problem.
SHC stands for shell script compiler.
- Read more: How to Encrypt Bash Script