A tool to encrypt and decrypt Bash scripts using Base64 encoding.
Project description
ShellSec
ShellSec is a Python package to encrypt and decrypt Bash scripts using Base64 encoding.
Installation
You can install ShellSec using pip:
pip install shellsec
Usage
Command-line Interface
ShellSec provides a command-line interface for encrypting and decrypting Bash scripts.
Encrypt a Bash script
shellsec --encrypt input_script.sh output_script.sh
Decrypt an obfuscated Bash script
shellsec --decrypt input_script.sh output_script.sh
Module Usage
You can also use ShellSec as a Python module in your scripts.
Encrypt a Bash script
import shellsec
shellsec.encrypt_script('input_script.sh', 'output_script.sh')
Decrypt an obfuscated Bash script
import shellsec
shellsec.decrypt_script('input_script.sh', 'output_script.sh')
Example
Encrypt a Bash script:
import shellsec
shellsec.encrypt_script('script.sh', 'encrypted_script.sh')
Decrypt an obfuscated Bash script:
import shellsec
shellsec.decrypt_script('obfuscated_script.sh', 'decrypted_script.sh')
This will print "encrypted" if the script is successfully encrypted or decrypted, and "Not encrypted" if there's an error during the process.
import shellsec
# Encrypt a script
if shellsec.encrypt_script('input_script.sh', 'output_script.sh'):
print("File encrypted successfully.")
else:
print("File not encrypted.")
# Decrypt a script
if shellsec.decrypt_script('input_script.sh', 'output_script.sh'):
print("File decrypted successfully.")
else:
print("File not decrypted.")
Notes
- When encrypting, ShellSec encodes the script content using Base64 and embeds it in a Bash script for easy decryption.
- When decrypting, ShellSec extracts the Base64 encoded content and decodes it back to the original script.
- Ensure to keep your encrypted scripts safe, as they contain sensitive information.
- ShellSec is designed for simple encryption purposes and may not provide strong security against determined attackers.
Thanks
Thank you for using ShellSec! If you find it helpful, consider starring the repository on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.