Password-based encryption toolkit for text and files. Includes a Python CLI, GUI, library, automated tests, CI, and optional Windows executable build.
- Encrypt and decrypt text (base64 output)
- Encrypt and decrypt any file (
.encoutput) - Hidden password input with
getpass - Versioned binary format (
CPT1) using PBKDF2 + AES-GCM - Backward-compatible decryption for legacy Fernet ciphertext
- Interactive menu, argparse CLI, and Tkinter GUI
- Pytest suite and GitHub Actions CI
- Dependabot and CodeQL security automation
- Python 3.10+
git clone https://github.com/Solzte/ciphertext.git
cd ciphertext
python -m venv .venvWindows:
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"macOS / Linux:
source .venv/bin/activate
pip install -e ".[dev]"python encrypt.pyciphertext encrypt "Hello, world!"
ciphertext decrypt "CPT1..."
ciphertext encrypt-file note.txt
ciphertext decrypt-file note.txt.encExamples with explicit password:
ciphertext encrypt "Secret message" -p my-password
ciphertext encrypt-file document.pdf -o document.pdf.enc -p my-passwordIf -p is omitted, the password is requested securely.
python gui.pyfrom ciphertext import encrypt, decrypt, encrypt_file, decrypt_file
token = encrypt("hello", "password")
print(decrypt(token, "password"))pip install pyinstaller
pyinstaller ciphertext.specThe GUI executable is created in dist/Ciphertext.exe.
pytestciphertext/
├── src/ciphertext/ # Python package
│ ├── crypto.py # Core crypto + file helpers
│ └── cli.py # Argparse CLI
├── tests/ # Pytest suite
├── gui.py # Tkinter desktop app
├── encrypt.py # Backward-compatible entry point
├── pyproject.toml
├── requirements.txt
├── requirements-dev.txt
├── ciphertext.spec # PyInstaller config
└── .github/
├── dependabot.yml # Automated dependency updates
└── workflows/
├── ci.yml # Test workflow
└── codeql.yml # Security analysis
Current encrypted payloads use this layout:
CPT1 | version(1) | salt(16) | nonce(12) | ciphertext+tag
Text output is base64-encoded. File output is raw binary.
Legacy Fernet ciphertext from v1 can still be decrypted by the Python tool.
- Keep your password safe. Lost passwords cannot be recovered.
- Do not commit
.env, secrets, or encrypted files you do not intend to share. - This project is for learning and personal use. Review your threat model before production use.
MIT — see LICENSE.