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.12.tar.gz (65.5 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.12-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: secure_string_cipher-1.0.12.tar.gz
  • Upload date:
  • Size: 65.5 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.12.tar.gz
Algorithm Hash digest
SHA256 fa133273a7d3785fa4cacb425d7374af3f0e57fa782f30b65761b022a5d3a3d4
MD5 4603433da49a67d73e81a419dcd01a69
BLAKE2b-256 1c34c7c520d088fcd4618753f07433a414aa505b467282cd0ef2bc950a3c0cc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for secure_string_cipher-1.0.12.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.12-py3-none-any.whl.

File metadata

File hashes

Hashes for secure_string_cipher-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 6e309c5a8d850091853d2b736ce23ad5efb5759900a30ca657523ae96d3291e3
MD5 bf4e8dafdf099c06c128ee35e067986a
BLAKE2b-256 783f279a504460fe842a7fbfb67b01e8e2b496cd48889a3fff05bb0dba14b4dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for secure_string_cipher-1.0.12-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