Skip to content

Commit 4f8ac9e

Browse files
committed
fix: make pip install cryptex-cli work out of the box + harden CLI (v1.2.0)
The published package crashed on startup for any user without the native `zbar` system library, because `pyzbar` was imported at module load time. Effectively every clean `pip install` on macOS/Linux was unusable. This release fixes that and tightens the CLI. Fixed - Replace `pyzbar` (needs a system `zbar` library that pip cannot install) with `zxing-cpp`, which ships self-contained binary wheels. A clean `pip install cryptex-cli` now runs with no extra system setup. QR-image and TOTP-from-image decoding behave exactly as before. Changed (BREAKING) - Saving to a file now uses an explicit `-o/--output FILE` option instead of a bare positional argument. Previously any stray word (e.g. `cryptex generate`) was silently written to a file of that name. Use `cryptex -o secrets.txt`. Removed - Drop end-of-life Python 3.8 and 3.9. Supported runtimes are now 3.10–3.13. Other - Add a terminal demo (assets/demo.gif) to the README. - Bump version to 1.2.0.
1 parent 566750f commit 4f8ac9e

6 files changed

Lines changed: 24 additions & 19 deletions

File tree

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66

77
[![PyPI version](https://img.shields.io/pypi/v/cryptex-cli.svg)](https://pypi.org/project/cryptex-cli/)
88
[![Downloads](https://static.pepy.tech/badge/cryptex-cli)](https://pepy.tech/project/cryptex-cli)
9-
[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://python.org)
9+
[![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://python.org)
1010
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
1111
[![Security](https://img.shields.io/badge/security-cryptographically%20secure-green.svg)](https://docs.python.org/3/library/secrets.html)
1212
[![CLI Framework](https://img.shields.io/badge/CLI-Click-brightgreen.svg)](https://click.palletsprojects.com/)
1313

1414
A **production-ready CLI tool** for generating cryptographically secure passwords with enterprise integrations, compliance templates, and advanced customization options.
1515

16+
<p align="center">
17+
<img src="assets/demo.gif" alt="Cryptex demo" width="100%">
18+
</p>
19+
1620
## Key Features
1721

1822
### Core Security
@@ -494,13 +498,13 @@ cryptex -l 12 --save-keychain --keychain-service "test" --keychain-account "test
494498
## Dependencies
495499

496500
### Required
497-
- Python 3.8+
501+
- Python 3.10+
498502
- click 8.0+ (CLI framework)
499503
- qrcode 7.0+ (QR code generation)
500504
- boto3 1.26+ (AWS integration)
501505
- hvac 1.0+ (Vault integration)
502506
- keyring 24.0+ (OS keychain)
503-
- pyzbar 0.1.9+ (QR code image decoding)
507+
- zxing-cpp 2.0+ (QR code image decoding — self-contained, no system libs)
504508
- Pillow 9.0+ (Image processing)
505509

506510
### Optional System Tools

assets/demo.gif

332 KB
Loading

cryptex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A production-ready CLI tool for generating secure passwords with advanced features.
44
"""
55

6-
__version__ = "1.1.0"
6+
__version__ = "1.2.0"
77
__author__ = "Tarek CHEIKH"
88
__email__ = "tarek@tocconsulting.fr"
99
__description__ = "Enhanced random password generator with advanced security features"

cryptex/cli.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,14 @@
229229
help='Vault URL',
230230
show_default=True
231231
)
232-
@click.argument(
233-
'output_file',
232+
@click.option(
233+
'-o', '--output', 'output_file',
234234
type=click.Path(),
235-
required=False
235+
default=None,
236+
help='Save generated password(s)/TOTP details to a file '
237+
'instead of printing to the terminal.'
236238
)
237-
@click.version_option(version='1.1.0', prog_name='cryptex')
239+
@click.version_option(version='1.2.0', prog_name='cryptex')
238240
def main(
239241
length: int,
240242
count: int,

cryptex/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
import click
1919
import qrcode
20+
import zxingcpp
2021
from PIL import Image
21-
from pyzbar.pyzbar import decode as pyzbar_decode
2222

2323

2424
class Colors:
@@ -149,9 +149,9 @@ def decode_qr_image(image_path: str) -> Optional[str]:
149149
"""Decode a QR code image and return its text content."""
150150
try:
151151
image = Image.open(image_path)
152-
decoded_objects = pyzbar_decode(image)
153-
if decoded_objects:
154-
return decoded_objects[0].data.decode('utf-8')
152+
results = zxingcpp.read_barcodes(image)
153+
if results:
154+
return results[0].text
155155
return None
156156
except Exception:
157157
return None

pyproject.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "cryptex-cli"
7-
version = "1.1.0"
7+
version = "1.2.0"
88
description = "Enhanced random password generator with advanced security features"
99
authors = [
1010
{name = "Tarek CHEIKH", email = "tarek@tocconsulting.fr"},
1111
]
1212
license = {text = "MIT"}
1313
readme = "README.md"
14-
requires-python = ">=3.8"
14+
requires-python = ">=3.10"
1515
dependencies = [
1616
"click>=8.0.0",
1717
"qrcode>=7.0.0",
1818
"boto3>=1.26.0",
1919
"hvac>=1.0.0",
2020
"keyring>=24.0.0",
21-
"pyzbar>=0.1.9",
21+
"zxing-cpp>=2.0.0",
2222
"Pillow>=9.0.0",
2323
]
2424

@@ -30,11 +30,10 @@ classifiers = [
3030
"License :: OSI Approved :: MIT License",
3131
"Operating System :: OS Independent",
3232
"Programming Language :: Python :: 3",
33-
"Programming Language :: Python :: 3.8",
34-
"Programming Language :: Python :: 3.9",
3533
"Programming Language :: Python :: 3.10",
3634
"Programming Language :: Python :: 3.11",
3735
"Programming Language :: Python :: 3.12",
36+
"Programming Language :: Python :: 3.13",
3837
"Topic :: Security",
3938
"Topic :: System :: Systems Administration",
4039
"Topic :: Utilities",
@@ -73,10 +72,10 @@ packages = ["cryptex"]
7372

7473
[tool.black]
7574
line-length = 100
76-
target-version = ['py38']
75+
target-version = ['py310', 'py311', 'py312', 'py313']
7776

7877
[tool.mypy]
79-
python_version = "3.8"
78+
python_version = "3.10"
8079
warn_return_any = true
8180
warn_unused_configs = true
8281
disallow_untyped_defs = true

0 commit comments

Comments
 (0)