Read this in other languages: Русский
A command-line tool for hashing and encrypting files, and for packing
programs into a self-launching executable. A single Python script with no extra
dependencies beyond cryptography.
- Hash a file with several algorithms in a single pass.
- Encrypt/decrypt a file with a password (AEAD, streaming — file size is not limited by memory).
pack— wrap any program into a self-launching.pylauncher.--standalone— build a self-contained executable (no Python needed on the target machine).--sign— sign the built.exewith your certificate (Windows).bundle— combine several programs into one file; all run openly.- Interactive menu when run without arguments.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt # cryptography; pyinstaller — for --standaloneRequires Python 3.10+.
python crypter.py hash file.txt # sha256 by default
python crypter.py hash file.txt -a sha256 -a md5 # several algorithms
python crypter.py hash file.txt --all # all at onceAvailable hashes: md5, sha1, sha256, sha512, sha3_256, sha3_512,
blake2b, blake2s (md5/sha1 — checksum only).
python crypter.py encrypt file.txt # -> file.txt.enc (AES-256-GCM)
python crypter.py encrypt file.txt -a chacha20 # ChaCha20-Poly1305
python crypter.py decrypt file.txt.enc # -> file.txtThe key is derived from the password via scrypt. The algorithm is stored in the
header, so you don't specify it when decrypting. Corruption or a wrong password is
detected (authenticated encryption). The password can be passed via the
CRYPTER_PASSWORD environment variable.
python crypter.py pack myprog.py # -> myprog_packed.py (needs Python)
python crypter.py pack myprog.py --standalone # -> myprog_app (no Python needed)
python crypter.py pack program.exe -i none # any binary, run directly
python crypter.py pack app.js -i node # custom interpreterOn start the launcher decrypts the program, runs it, passes command-line arguments through, and returns its exit code. A Python program runs in-process (no temp file); anything else runs via a temporary file that is deleted after exit.
python crypter.py bundle prog1.py prog2.exe # one after another
python crypter.py bundle prog1.py prog2.exe -p # all at once
python crypter.py bundle prog1.py prog2.py --standaloneAll programs run openly, their output is visible. The resulting exit code is the highest of the codes (non-zero if any program failed).
python crypter.py pack myprog.py --standalone --sign mycert.pfx --sign-password PASSWORDRequires your .pfx certificate and signtool (from the Windows SDK). You obtain the
certificate yourself: buy one from a certificate authority for public distribution, or
make a self-signed one for your own machines. Signing confirms the author and removes
SmartScreen/antivirus warnings — it is unrelated to encrypting the contents.
PyInstaller builds the file for the OS it runs on — there is no cross-compilation.
To get a Windows .exe, run --standalone on Windows (Python + pyinstaller are only
needed on the build machine, not on the target).
encrypt/decrypt— real encryption: without the password the data cannot be read.pack/bundlewithout a password — this is obfuscation, not strong protection: the key is embedded in the launcher and a skilled person can extract it. It protects against an ordinary user, but not against a reverse engineer.
MIT