SFC is a Generic shell script compiler. We can use SFC binary to encrypt the shell script. Using SFC you can set the expiry date of your shell script.
yum install shc
shc [ -e date ] [ -m addr ] [ -i iopt ] [ -x cmnd ] [ -l lopt ] [ -o outfile ] [ -ABCDhUHvSr ] -f script
encrypt the blackpost.sh
shc -f blackpost.sh
blackpost.sh is the original unencrypted shell script
blackpost.sh.x is the encrypted shell script in binary format
blackpost.sh.x.c is the C source code of the blackpost.sh file.
This C source code is compiled to create the above encrypted blackpost.sh.x file.
The whole logic behind the shc is to convert the blackpost.sh shell script to blackpost.sh.x.c C program (and of course compile that to generate the blackpost.sh.x executable
Expiration Date for Shell Script:-
shc -e 11/11/2022 -m “call to aniljalela” -f blackpost.sh
Redistributable Encrypted Shell Scripts:-
-r will relax security to create a redistributable binary that executes on other systems that runs the same operating system as the one on which it was compiled.
-v is for verbose
shc -v -r -f blackpost.sh