filecrypt is a standalone Python utility to compress and encrypt or decrypt files and directories.
It uses AES-256-CBC encryption and allows progress display during operations.
You can generate a key automatically, provide one in hex, or use a key file. The tool works via command-line arguments.
This project uses uv for fast and reproducible dependency management.
1️⃣ Create a virtual environment:
uv venv .venv2️⃣ Install dependencies:
uv sync --no-install-projectEncrypt a file or directory:
uv run python filecrypt.py --encrypt -i /path/to/input -o /path/to/output -pDecrypt an encrypted file:
uv run python filecrypt.py --decrypt -i /path/to/encrypted_file -o /output/directory -k /path/to/keyfile -pArguments:
--encrypt: Encrypt mode.--decrypt: Decrypt mode.-i,--input: Input file or directory.-o,--output: Output file or directory.-k,--key: Key file or hex string (optional for encryption, required for decryption).-p,--progress: Show progress during processing.
Use PyInstaller via uv to generate a single-file executable:
uv run pyinstaller --clean --onefile filecrypt.pyThe resulting binary will be available in the dist/ folder.
cryptographypyinstalleruv(for dependency management)
Dependencies are listed in pyproject.toml.
- The script automatically saves encryption keys in your system's temporary directory.
- It uses a timestamp and OS tag for versioned output filenames.
- Encrypted files contain the IV prepended to the content.
- Only AES-256-CBC with PKCS7 padding is supported.
- Linux
- Windows