Skip to main content

A secure AES-GCM encryption utility with user-friendly features

Project description

secure-string-cipher

CI License: MIT Python Versions

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

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secure_string_cipher-1.0.1.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secure_string_cipher-1.0.1-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file secure_string_cipher-1.0.1.tar.gz.

File metadata

  • Download URL: secure_string_cipher-1.0.1.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for secure_string_cipher-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a4731bf5395ad28e065ecfcf017644e46f31de243160971ecf56e0b7015c54a5
MD5 3fe4e71d607bf65ad5c485d619d264ab
BLAKE2b-256 d59736d63b0bb33e22194583eccd5539708206d0e55043d3da4674e36832e12d

See more details on using hashes here.

File details

Details for the file secure_string_cipher-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for secure_string_cipher-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3b60f3aeb9a3b24e82a7569629a98b896edb8b43e130236c14e98963a361e30
MD5 16e2d4234b5e3d1b708d186e3085d560
BLAKE2b-256 b8cc78cf96427893c199b334897c6ef8dd4f2779ba138e47cdd949386e6bc5f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page