Skip to main content

QabPassGen 🔐⚛️

Quantum-Entropy Password Generator — powered by real IBM Quantum hardware or local Aer simulation.

qabpassgen generates cryptographically strong passwords using true quantum randomness. It applies Hadamard gates to put qubits into superposition, measures their collapse, and converts the resulting bitstream into passwords via rejection sampling (eliminating modulo bias). Password strength is then verified by zxcvbn.

📦 Installation

pip install qabpassgen

Note: Requires Python >=3.9, <3.13


🚀 Usage

Minimal — Simulator (no token needed)

import qabpassgen

result = qabpassgen.generate_password()
print(result['password'])
# Example: "X7kPq2mNvLz!8Yw3A#m"

With all options

import qabpassgen

result = qabpassgen.generate_password(
    ibm_token="YOUR_IBM_QUANTUM_TOKEN",  # Optional: use real hardware
    length=32,
    use_symbols=True,
    use_numbers=True
)
print(result['password'])

Pretty terminal report

import qabpassgen

result = qabpassgen.generate_password(length=24, use_symbols=True, use_numbers=True)
qabpassgen.print_report(result)
╔══════════════════════════════════════════════════════╗
║              QUANTUM ENTROPY AUDIT                   ║
╠══════════════════════════════════════════════════════╣
║ PASS: X7#kPq@2mNvLz!8Yw3A#m                         ║
║ RANK: 4/4 Security Score                             ║
║ TIME: centuries                                      ║
║ BITS: 87.3 Shannon Entropy                           ║
╟──────────────────────────────────────────────────────╢
║ FROM: Aer_Quantum_Sim                                ║
║ UTIL: 96.1% Yield Efficiency                         ║
║ LOAD: 0.312s                                         ║
╚══════════════════════════════════════════════════════╝

📖 API Reference

generate_password(...) → dict

Parameter Type Default Description
ibm_token str None IBM Quantum API token. Uses real hardware if provided; falls back to Aer simulator if omitted or if hardware is offline.
length int 20 Number of characters in the password.
use_symbols bool True Include symbols: !@#$%^&*
use_numbers bool True Include digits 0–9

Returns a dict:

{
    "password": "X7#kPq@2mNvLz!8Yw3A#m",
    "metrics": {
        "strength": "4/4",          # zxcvbn score
        "crack_time": "centuries",  # estimated offline crack time
        "entropy": 87.3             # Shannon entropy in bits
    },
    "provenance": {
        "source": "Aer_Quantum_Sim",  # or real IBM device name e.g. "ibm_kyiv"
        "bits": 1920,                 # total quantum bits consumed
        "yield": "96.1%",            # rejection sampling efficiency
        "latency": "0.312s"          # total generation time
    }
}

print_report(result)

Renders a formatted terminal report. Pass the dict returned by generate_password().

qabpassgen.print_report(result)

🧠 How It Works

  1. Quantum Circuit: Creates a circuit with Hadamard gates on all qubits → perfect 50/50 superposition.
  2. Measurement: Collapses qubits to classical bits → true quantum randomness.
  3. Bitstream: Raw measurements are packed into 8-bit integers (0–255).
  4. Rejection Sampling: Bytes outside the uniform range are discarded to eliminate modulo bias.
  5. Hardware Fallback: If a token is given but IBM hardware is unreachable, automatically uses the local Aer simulator.
  6. Strength Check: Result is validated with zxcvbn.

🔑 IBM Quantum Token

To use real quantum hardware, get a free token at quantum.ibm.com and pass it as ibm_token. Without a token, the local Aer simulator is used automatically.

You can also set it via environment variable:

export IBM_QUANTUM_TOKEN="your_token_here"
import os, qabpassgen
result = qabpassgen.generate_password(ibm_token=os.getenv("IBM_QUANTUM_TOKEN"))

🛡️ Dependencies

  • qiskit — quantum circuit definition
  • qiskit-aer — local quantum simulator
  • qiskit-ibm-runtime — real IBM Quantum hardware access
  • zxcvbn — password strength estimation

📄 License

MIT License — see LICENSE for details.

Metadata

Release files for qabpassgen 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qabpassgen 0.1.1
File Size Uploaded Provenance
qabpassgen-0.1.1.tar.gz 6.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for qabpassgen 0.1.1
File Interpreter ABI Platform
qabpassgen-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / qabpassgen-0.1.1.tar.gz

Download URL qabpassgen-0.1.1.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c84cc4f03c19ad9fb794f2654bc84a15b9d3be250aebb68c5db1634f4955ab70
BLAKE2b-256 checksum
How to use checksums
a235fbafdc99bbeeb563482a9d228bdd9ff2db975ec0762fb2264b8f21a90fca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

Release files / qabpassgen-0.1.1-py3-none-any.whl

Download URL qabpassgen-0.1.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
118d4936dcf5c8a63479ae8fdc6a7ccd075f1899abd68c50cc85aecece6d3f6f
BLAKE2b-256 checksum
How to use checksums
5aadcbf43865f044c354f01e76f25869db62a5d1e8bbad3bfd6d5025d486be12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

Security for qabpassgen 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qabpassgen-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page