Skip to main content

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

Project description

secure-string-cipher

CI License: MIT Python Compatibility

A simple, secure AES-256-GCM encryption tool with an interactive menu interface.

Developed for: Python 3.14
Backward compatible to: Python 3.10+

Features

  • Encrypt and decrypt text and files with AES-256-GCM
  • Generate strong random passphrases with entropy calculation
  • Store passphrases in an encrypted vault (optional)
    • HMAC-SHA256 integrity verification to detect tampering
    • Automatic backup creation (keeps last 5 backups)
    • Atomic writes to prevent corruption
  • Stream large files in chunks for low memory usage
  • Text output in Base64 for easy copy/paste
  • Clipboard integration available

Installation

Note: This project is developed for Python 3.14 (latest stable) and is backward compatible to Python 3.10+. We follow Python's official support policy and may drop support for older versions as they reach end-of-life.

# Recommended: install with pipx
pipx install secure-string-cipher

# Or with pip
pip install secure-string-cipher

# Or from source
git clone https://github.com/TheRedTower/secure-string-cipher.git
cd secure-string-cipher
pip install .

Usage

Run the interactive CLI:

cipher-start

You'll see this menu:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                       AVAILABLE OPERATIONS                     ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃                                                                ┃
┃  TEXT & FILE ENCRYPTION                                        ┃
┃                                                                ┃
┃    [1] Encrypt Text      →  Encrypt a message (base64 output)  ┃
┃    [2] Decrypt Text      →  Decrypt an encrypted message       ┃
┃    [3] Encrypt File      →  Encrypt a file (creates .enc)      ┃
┃    [4] Decrypt File      →  Decrypt an encrypted file          ┃
┃                                                                ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃  PASSPHRASE VAULT (Optional)                                   ┃
┃                                                                ┃
┃    [5] Generate Passphrase  →  Create secure random password   ┃
┃    [6] Store in Vault       →  Save passphrase securely        ┃
┃    [7] Retrieve from Vault  →  Get stored passphrase           ┃
┃    [8] List Vault Entries   →  View all stored labels          ┃
┃    [9] Manage Vault         →  Update or delete entries        ┃
┃                                                                ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃    [0] Exit                →  Quit application                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Choose an option and follow the prompts.

Docker

Use the pre-built image (Python 3.14-alpine based):

# Pull and run
docker pull ghcr.io/theredtower/secure-string-cipher:latest
docker run --rm -it ghcr.io/theredtower/secure-string-cipher:latest

# Or with Docker Compose
git clone https://github.com/TheRedTower/secure-string-cipher.git
cd secure-string-cipher
docker compose run --rm cipher

To encrypt files in your current directory:

docker run --rm -it \
  -v "$PWD:/data" \
  ghcr.io/theredtower/secure-string-cipher:latest

With persistent passphrase vault (including backups):

docker run --rm -it \
  -v "$PWD:/data" \
  -v cipher-vault:/home/cipheruser/.secure-cipher \
  ghcr.io/theredtower/secure-string-cipher:latest

Image details: ~78MB Alpine-based image, Python 3.14, runs as non-root user (UID 1000), includes HMAC integrity verification and automatic backups.

Security

  • Encryption: AES-256-GCM with authenticated encryption
  • Key derivation: PBKDF2-HMAC-SHA256 (390,000 iterations)
  • Passphrase vault: Encrypted with AES-256-GCM using your master password
  • Vault integrity: HMAC-SHA256 verification detects file tampering
  • Automatic backups: Last 5 vault backups saved in ~/.secure-cipher/backups/
  • File permissions: Vault files are user-only (chmod 600)
  • Password requirements: Minimum 12 characters with complexity checks

Development

Quick Start

# Clone and install with dev dependencies
git clone https://github.com/TheRedTower/secure-string-cipher.git
cd secure-string-cipher
pip install -e ".[dev]"

# Format code before committing
make format

# Run the full test suite
make ci

Available Commands

make format      # Auto-format code with Ruff
make lint        # Check formatting, types, and code quality
make test        # Run test suite
make test-cov    # Run tests with coverage report
make clean       # Remove temporary files
make ci          # Run complete CI pipeline locally

Tools

  • Ruff – Fast linter and formatter (replaces Black, isort, flake8)
  • mypy – Static type checking
  • pytest – Testing framework with 150+ tests

Run make format before pushing, then make ci to verify everything passes.

License

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.14.tar.gz (68.4 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.14-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: secure_string_cipher-1.0.14.tar.gz
  • Upload date:
  • Size: 68.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for secure_string_cipher-1.0.14.tar.gz
Algorithm Hash digest
SHA256 93c17b9aff4d9659cfa2830a0e39558311cbd5ab1fa82d62b95718194abcd7d2
MD5 2053610cdd9b605745222688628cbe98
BLAKE2b-256 0074ced196a593da994a57a858faa50087b77f43f55e624c0ca22e5a74df7fae

See more details on using hashes here.

Provenance

The following attestation bundles were made for secure_string_cipher-1.0.14.tar.gz:

Publisher: release.yml on TheRedTower/secure-string-cipher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for secure_string_cipher-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 7ac4c85cb1f56a3265d7c5d1ef3e21f480ca2db1295f82c60c6f4030985038f7
MD5 c5a8cef3e6eb368e64de3b98071451ce
BLAKE2b-256 4d94d336ac1bfc076a23c66c7263de1f026520aeb537b3448e6e39674c167143

See more details on using hashes here.

Provenance

The following attestation bundles were made for secure_string_cipher-1.0.14-py3-none-any.whl:

Publisher: release.yml on TheRedTower/secure-string-cipher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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