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 string-cipher

This installs a globally available string-cipher 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:

string-cipher

Or use flags:

string-cipher --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 string-cipher
docker build -t yourusername/string-cipher .

# Run interactively
docker run --rm -it yourusername/string-cipher

# Encrypt a file (bind current directory)
docker run --rm -it -v "$PWD":/data yourusername/string-cipher encrypt-file /data/secret.txt
docker run --rm -it -v "$PWD":/data yourusername/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.0.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.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: secure_string_cipher-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 47b9eda42100e3a63717617117206f97ab01f4eb064248329a958a3ec25972d3
MD5 cc80b29813129752f04c7a13bf4cd5d7
BLAKE2b-256 c3b1e066b60a206d028acc36086fd722feec543df22e7fc07051adef6547366e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for secure_string_cipher-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b8577fd31968cc0c4cc1bf8f86c35681283ed93bf157762e588cb420002cfcd
MD5 8c1b885d8b43485eeacf96c570aa6f4c
BLAKE2b-256 b5ed9612a3493e7623b3dba6e75a4e9d9b93c7092bedfac294e71d1d15cd7c4a

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