Can you use SHC to obfuscate a script?

Can you use SHC to obfuscate a script?

The way SHC works is actually pretty straight-forward. When using it to obfuscate a script, you have to re-compile the script for whichever OS you intend to run it on. What that means is, you cannot run the SHC compiler on a ubuntu box and expect the produced script to work on a Red Hat/CentOS box.

Which is the best tool to obfuscate a shell script?

Use openssl! If your scripts are really that sensitive, then Openssl (or a similar tool) is probably the best option for you. Why? Because the openssl tool in particular is present on most Unix systems…i.e. Ubuntu, CentOS, Red Hat, Macs, AIX. It comes as part of the default installation.

What’s the difference between obfuscation and minification in Bash?

Minification means reducing the size of a script by removing all unnecessary characters from source code without changing its functionality. Obfuscation on the other hand means making the script difficult, if not impossible, to read. To minify a big script, you can run the following code against the actual script you want to minify:

Which is the best way to obfuscate JavaScript?

First, you could do some kind of encryption, which is decrypted at page load. That would probably be one of the most secure options, but also a lot of work which may be unnecessary. You could probably base64 encode some string values, and that would be easier.. but someone who really wanted those string values could easily decode them.

How to obfuscate a shell script in Bash?

From the man page: shc creates a stripped binary executable version of the script specified with -f on the command line. What you want to do is not readily possible. Scripts are interpreted, not compiled, that’s why you see text in there. For an script to be executed, the effective user must have read access to it.

How is the obfuscated script printed to STDO?

The obfuscated script version is printed to stdo. The original script is not modified. Using obfsh options cleverly, one may fool more then just a casual intruder or snooper, and certainly make understanding of the obfuscated script harder and more time consuming.