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.2.tar.gz (24.1 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.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: secure_string_cipher-1.0.2.tar.gz
  • Upload date:
  • Size: 24.1 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.2.tar.gz
Algorithm Hash digest
SHA256 afce540c15c11295dd1f448e295213b5cf3f881a9297bd7ec1ec160dc55367d4
MD5 2bb5075b17f59aa4bd97745ead9f47d8
BLAKE2b-256 8ba5cd2ae6e704eb70e9bbb285583aa3a2165b7b4d285577e95aaf971fd23de3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for secure_string_cipher-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a9c61993794f2db83b6dfc6876f3a9bc823863ba6e002210d65c0de8e9401ce6
MD5 3c544de5052d695ff8b45136db61b41e
BLAKE2b-256 6f3b1077704fbeacca00d7ab3187f15d4fc6f7656020aa4dcb32ec45d4e470af

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