Metadata-Version: 2.4
Name: secure-string-cipher
Version: 1.0.2
Summary: A secure AES-GCM encryption utility with user-friendly features
Project-URL: Homepage, https://github.com/TheRedTower/secure-string-cipher
Project-URL: Bug Tracker, https://github.com/TheRedTower/secure-string-cipher/issues
Project-URL: Documentation, https://github.com/TheRedTower/secure-string-cipher/wiki
Project-URL: Changelog, https://github.com/TheRedTower/secure-string-cipher/blob/main/CHANGELOG.md
Author-email: TheRedTower <security@avondenecloud.uk>
License: MIT License
        
        Copyright (c) 2025 Your Name
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Requires-Dist: cryptography>=41.0.0
Requires-Dist: pyperclip>=1.8.0
Provides-Extra: dev
Requires-Dist: bandit>=1.7.5; extra == 'dev'
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: safety>=2.3.0; extra == 'dev'
Requires-Dist: tox>=4.11.0; extra == 'dev'
Requires-Dist: twine>=4.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# secure-string-cipher

[![CI](https://github.com/TheRedTower/secure-string-cipher/actions/workflows/ci.yml/badge.svg)](https://github.com/TheRedTower/secure-string-cipher/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python Versions](https://img.shields.io/pypi/pyversions/secure-string-cipher.svg)](https://pypi.org/project/secure-string-cipher/)

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)

```bash
pipx install secure-string-cipher
```

This installs a globally available `cipher-start` command in an isolated environment.

### From source

```bash
git clone https://github.com/TheRedTower/secure-string-cipher.git
cd secure-string-cipher
pip install .
```

## Usage

Run the interactive wizard:

```bash
cipher-start
```

Or use flags:

```bash
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:

```bash
# 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](LICENSE) for details.
