A secure AES-GCM encryption utility with user-friendly features
Project description
secure-string-cipher
Interactive AES-GCM Encrypt/Decrypt Tool
Features
- 🔐 Encrypt or decrypt text or files using a passphrase
- 🛡️ AES-256-GCM with PBKDF2-HMAC-SHA256 key derivation (390,000 iterations)
- ⚡ Streams file encryption/decryption in 64 KiB chunks (low memory footprint)
- 📋 Text mode wraps ciphertext/tag in Base64 for easy copy/paste
- 📎 Optional clipboard copy via pyperclip in text mode
- 🎨 Colourised, menu-driven interactive wizard with clear operation descriptions
- ✅ Test-friendly CLI with dependency injection support
Installation
Via pipx (recommended)
pipx install secure-string-cipher
This installs a globally available cipher-start command in an isolated environment.
From source
git clone https://github.com/TheRedTower/secure-string-cipher.git
cd secure-string-cipher
pip install .
Usage
Run the interactive wizard:
cipher-start
The CLI will present you with a clear menu of operations:
Available Operations:
1. Encrypt text
2. Decrypt text
3. Encrypt file
4. Decrypt file
5. Exit
Select operation [1]:
Or use flags:
cipher-start --help
Programmatic use and test-friendly CLI
The CLI entry point is available as a Python function for tests and programmatic usage:
from io import StringIO
from secure_string_cipher.cli import main
# Provide input/output streams and disable exiting on completion
mock_in = StringIO("1\nHello, World!\nStrongP@ssw0rd!#\nStrongP@ssw0rd!#\n")
mock_out = StringIO()
main(in_stream=mock_in, out_stream=mock_out, exit_on_completion=False)
print(mock_out.getvalue())
- in_stream/out_stream: file-like objects used for input/output (default to sys.stdin/sys.stdout).
- exit_on_completion: when True (default), the CLI exits the process on success or error; when False, it returns 0 (success) or 1 (error).
This design makes the CLI deterministic and easy to unit test without relying on global stdout patches.
Docker
Alternatively, run via Docker without installing anything locally:
# Build the image (once)
cd secure-string-cipher
docker build -t yourusername/secure-string-cipher .
# Run interactively
docker run --rm -it yourusername/secure-string-cipher
# Encrypt a file (bind current directory)
docker run --rm -it -v "$PWD":/data yourusername/secure-string-cipher encrypt-file /data/secret.txt
docker run --rm -it -v "$PWD":/data yourusername/secure-string-cipher decrypt-file /data/secret.txt.enc
License
This project is licensed under the MIT License. See LICENSE for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secure_string_cipher-1.0.3.tar.gz.
File metadata
- Download URL: secure_string_cipher-1.0.3.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15e5d61f2f141a4f8e54e70cf599c85975fd5176889e79a54ef6221d50dee0cf
|
|
| MD5 |
c2fe7e045a9305e465abe630b69441b0
|
|
| BLAKE2b-256 |
6b7c04c7426f26938b683509e125c25950b8f0b6617949fefd06d1a0c6572cde
|
File details
Details for the file secure_string_cipher-1.0.3-py3-none-any.whl.
File metadata
- Download URL: secure_string_cipher-1.0.3-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bde99cb9ab0e2a7c15b92b7b052437b0a28d60182c5e433878e3ef4f5f48203
|
|
| MD5 |
6cb0f65523ef91c9ac5753d24c8822eb
|
|
| BLAKE2b-256 |
9744b84e3ff00de6a392f2c7908312e3d7c4ec9438dc95d48654607353fa0804
|