Q: How do I encrypt my bash shell script on Linux environment? The shell script contains password, and I don't want others who have execute access to view the shell script and get the password. Is there a way to encrypt my shell script?
A: First, as a best practice you should not be encrypting your shell script. You should really document your shell script properly so that anybody who views it understands exactly what it does. If it contains sensitive information like password, you should figure out a different approach to write the shell script without having to encrypt it.
That being said, if you still insist on encrypting a shell script, you can use SHC utility as explained below. Please note that encrypted shell script created by shc is not readable by normal users. However someone who understands how this works can extract the original shell script from the encrypted binary created by shc.
Jan 14, 2016. MSE MAXScript Encrypted file (. An encrypted MAXScript uses a binary format that can't be read or edited, but that 3ds Max can run as it would an ordinary MS file. MZP MAXScript Zip Package file (. A MAXScript Zip package collects the related files that make up a scripted tool into a single file that you can run as you do an ordinary MS file.
SHC stands for shell script compiler.
1. Download shc and install it
Download shc and install it as shown below.
Verify that shc is installed properly.
2. Create a Sample Shell Script
Create a sample bash shell script that you like to encrypt using shc for testing purpose.
For testing purpose, let us create the following random.sh shell script which generates random numbers. You have to specify how many random numbers you like to generate.
Decrypt Max Script Online
3. Encrypt the Shell Script Using shc
Encrypt the random.sh shell scripting using shc as shown below.
This will create the following two files:
- random.sh is the original unencrypted shell script
- random.sh.x is the encrypted shell script in binary format
- random.sh.x.c is the C source code of the random.sh file. This C source code is compiled to create the above encrypted random.sh.x file. The whole logic behind the shc is to convert the random.sh shell script to random.sh.x.c C program (and of course compile that to generate the random.sh.x executable)
4. Execute the Encrypted Shell Script
Now, let us execute the encrypted shell script to make sure it works as expected.
Please note that the binary itself is still dependent on the shell (the first line provided in the random.sh. i.e /bin/bash) to be available to execute the script.
5. Specifying Expiration Date for Your Shell Script
Using shc you can also specify an expiration date. i.e After this expiration date when somebody tries to execute the shell script, they'll get an error message.
Let us say that you don't want anybody to execute the random.sh.x after 31-Dec-2011 (I used last year date for testing purpose).
Create a new encrypted shell script using 'shc -e' option to specify expiration date. The expiration date is specified in the dd/mm/yyyy format.
In this example, if someone tries to execute the random.sh.x, after 31-Dec-2011, they'll get a default expiration message as shown below.
If you like to specify your own custom expiration message, use -m option (along with -e option as shown below).
6. Create Redistributable Encrypted Shell Scripts
Apart from -e, and -m (for expiration), you can also use the following options:
- -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.
- -T will allow the created binary files to be traceable using programs like strace, ltrace, etc.
- -v is for verbose
Typically you might want to use both -r and -T option to craete a redistributable and tracable shell encrypted shell script as shown below.
Finally, it is worth repeating again: You should not be encrypting your shell script in the first place. But, if you decided to encrypt your shell script using shc, please remember that a smart person can still generate the original shell script from the encrypted binary that was created by shc.
If you enjoyed this article, you might also like..
Next post: How to Calculate IP Header Checksum (With an Example)
Previous post: Intro to DOCSIS Architecture, CM CMTS Protocol for Cable Modems
Strong encryption
File security with 128-bit or 256-bit AES encryption.
Cloud storage awareness
Automatically secure your files in Dropbox, Google Drive etc.
Multilingual
AxCrypt speaks English, Dutch, French, German, Italian, Korean, Portuguese, Spanish, Swedish, Turkish, Russian, Polish and more to come.
Collaboration
Allow secured files to be opened by other AxCrypt users with their own password.
Password management
Manage and access your passwords seamlessly wherever you are.
AxCrypt Mobile
Open your encrypted files on your phone.
2. Encrypt
Select which files to secure with just a few clicks
3. Share
Share your secured files with a single click
This is a video tutorial on how to get started with AxCrypt.
For further details, head over to our documentation
AxCrypt makes everything about encryption simple, so you shouldn't be surprised to learn that it even makes PKI exchange of secure data simple (…) For these reasons, AxCrypt joins CertainSafe as an Editors' Choice for encryption.
PC MAG, 2016, 2017, 2018, 2019 & 2020It is the best and well-known encryption tool that is perfect to encrypt any files on your computer.
TRICKS ERA, 2018AxCrypt is a good bet of you want something reliable.
TECHRADAR.PRO, 2018, 2019 & 2020It keeps your files secure which is not so difficult because AxCrypt makes it easier.
ZERONETWORK, 2018The best encryption service available by subscription is AxCrypt.
WINDOWS CENTRAL, 2017Decrypt Max Script Pdf
AxCrypt is a software that enables you to easily encrypt files and folders. It's essential when you are sharing your computer with multiple users and want to maintain your privacy.
Decrypt Max Script Download
SOFTPEDIA, 2016It's really easy to use and easy to integrate into your workflow, thanks to its shell support. If you're eager for more options, it also has a ton of command line options, so you can fire up the command prompt in Windows and perform more complex actions—or multiple actions at once.
LIFEHACKER, 2015If you need to compress, encrypt, decrypt or shred files, AxCrypt is a powerful solution. With a host of features that can be easily accessed in any part of the Windows operating system, this application is easily the top choice amongst free file encryption software.
DOWNLOAD 3K, 2012AxCrypt is a free and easy to use security software solution that will ensure nobody has access to your private, sensitive information.
Manage and access your passwords seamlessly wherever you are.
AxCrypt Mobile
Open your encrypted files on your phone.
2. Encrypt
Select which files to secure with just a few clicks
3. Share
Share your secured files with a single click
This is a video tutorial on how to get started with AxCrypt.
For further details, head over to our documentation
AxCrypt makes everything about encryption simple, so you shouldn't be surprised to learn that it even makes PKI exchange of secure data simple (…) For these reasons, AxCrypt joins CertainSafe as an Editors' Choice for encryption.
PC MAG, 2016, 2017, 2018, 2019 & 2020It is the best and well-known encryption tool that is perfect to encrypt any files on your computer.
TRICKS ERA, 2018AxCrypt is a good bet of you want something reliable.
TECHRADAR.PRO, 2018, 2019 & 2020It keeps your files secure which is not so difficult because AxCrypt makes it easier.
ZERONETWORK, 2018The best encryption service available by subscription is AxCrypt.
WINDOWS CENTRAL, 2017Decrypt Max Script Pdf
AxCrypt is a software that enables you to easily encrypt files and folders. It's essential when you are sharing your computer with multiple users and want to maintain your privacy.
Decrypt Max Script Download
SOFTPEDIA, 2016It's really easy to use and easy to integrate into your workflow, thanks to its shell support. If you're eager for more options, it also has a ton of command line options, so you can fire up the command prompt in Windows and perform more complex actions—or multiple actions at once.
LIFEHACKER, 2015If you need to compress, encrypt, decrypt or shred files, AxCrypt is a powerful solution. With a host of features that can be easily accessed in any part of the Windows operating system, this application is easily the top choice amongst free file encryption software.
DOWNLOAD 3K, 2012AxCrypt is a free and easy to use security software solution that will ensure nobody has access to your private, sensitive information.
FINDMYSOFT, 2012For more testimonials, head over to awards & reviews