Compile shell scripts into encrypted static binaries.
- VM-based execution - Scripts compiled to bytecode, executed by built-in VM runtime
- Encryption - AES-256-GCM with micro-chunking
- Self-verifying binaries - Tamper detection via binary hash binding
- Portable execution - Bundled BusyBox for cross-platform compatibility
- Memory execution - BusyBox runs from memory (memfd), no disk artifacts
- Expiration dates - Optional time-limited script execution
- No dependencies - Static musl binaries, runs on any Linux
- Linux kernel 3.17+ (for
memfd_createsyscall) - Rust 1.85+ (edition 2024)
curl -fsSL https://raw.githubusercontent.com/iamlooper/SHX/main/scripts/install.sh | shOr manually download from Releases.
git clone https://github.com/iamlooper/SHX.git
cd SHX
./build.sh
sudo cp target/release/shx /usr/local/bin/./build.sh # Build for host architecture
./build.sh x86_64 # Build for x86_64-unknown-linux-musl
./build.sh i686 # Build for i686-unknown-linux-musl
./build.sh aarch64 # Build for aarch64-unknown-linux-musl
./build.sh armv7 # Build for armv7-unknown-linux-musleabihf
./build.sh all # Build for all architectures# Compile script for x86_64
shx -f script.sh -a x86_64 -o script.x
# Run the compiled binary
./script.xNotes:
shxis the compiler CLI. The output is the compiled script binary (for examplescript.x).- Some shell behaviors are implemented natively by the VM, while others are delegated to BusyBox
ashat runtime for compatibility. See the documentation links below.
# Script expires on 2025-12-31
shx -f script.sh -a x86_64 -e 2025-12-31 -m "License expired"OPTIONS:
-f, --file <SCRIPT> Shell script to compile (required)
-a, --arch <ARCH> Target architecture (required)
-o, --output <NAME> Output binary name [default: <script>.x]
-e, --expire <DATE> Expiration date (YYYY-MM-DD)
-m, --expire-msg <MSG> Message on expiration
-v, --verbose Verbose output
--list List supported architectures
-h, --help Print help
-V, --version Print version
| Architecture | Rust Target |
|---|---|
x86_64 |
x86_64-unknown-linux-musl |
x86 |
i686-unknown-linux-musl |
aarch64 |
aarch64-unknown-linux-musl |
armv7 |
armv7-unknown-linux-musleabihf |
For non-x86 targets, install the appropriate Rust target:
# ARM64 (aarch64)
rustup target add aarch64-unknown-linux-musl
# ARM32 (armv7)
rustup target add armv7-unknown-linux-musleabihf- Architecture - System design and component overview
- Features - Supported shell syntax and built-ins
- Security - Security model and considerations
MIT License - see LICENSE