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.
Source Distribution
Built Distribution
File details
Details for the file shellsec-1.0.1.tar.gz
.
File metadata
- Download URL: shellsec-1.0.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a12cad6fc63dd5e6214c952a0bcd6a1090ad6abd1b0acbb34304dda07482898c |
|
MD5 | bcc6c8ee9a09af057190355340318f82 |
|
BLAKE2b-256 | 8a1f6ad87f63b4477ca3d45386fda9f829cc5c338132db0628a0760b5d981501 |
File details
Details for the file shellsec-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: shellsec-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e619c24b7917d5afb471969f3dc21eaed10efef5c9c3d3b4bbaa9bacbe69a1ee |
|
MD5 | b7151d87dfe9c73a44573f87972a833c |
|
BLAKE2b-256 | 0705044c84bdf25addb846a001d0ce51c74a186a2609172e8a8314b349904fd4 |