Skip to main content

Post-quantum mesh VPN library with WireGuard, PQClean, Pyshark, Scapy, and Logging4

Project description

๐Ÿง  pqbit

PyPI License Build Coverage


Author: Kito Hamachi โ€” Bit512 Labs
License: MIT
Repository: github.com/kitohamachi/pqbit
PyPI: pypi.org/project/pqbit


๐Ÿ“– Table of Contents


๐Ÿงช Usage Examples

from pqbit import falcon_keypair, falcon_sign, falcon_verify

pk, sk = falcon_keypair()
message = b"Bit512 integrity test"
signature = falcon_sign(message, sk)

if falcon_verify(message, signature, pk):
    print("Signature verified โœ…")
else:
    print("Signature failed โŒ")

๐Ÿš€ Project Overview

pqbit is a Python security and networking library that combines cutting-edge technologies to create a resilient, distributed, post-quantum digital infrastructure. It is designed for researchers, engineers, and enthusiasts seeking to build secure and intelligent systems with complete control.


๐Ÿงฉ Key Components

  • ๐Ÿ” Post-Quantum Security
    Uses algorithms such as Kyber1024 and Falcon1024 for quantum-resistant key exchange and digital signatures.

  • ๐Ÿ•ธ๏ธ Intelligent Mesh Network
    Automatic configuration of WireGuard tunnels between multiple nodes with mesh topology and least privilege.

  • ๐Ÿ”ญ Distributed Authentication
    Each node signs its identity with Falcon and validates peers before accepting packets, ensuring end-to-end trust.

  • ๐Ÿงฌ Adaptive Routing
    Dynamic neighbor selection based on traffic entropy and latency, prioritizing security and performance.

  • ๐Ÿ›ฐ๏ธ Encrypted Broadcast
    Discovery messages are encapsulated with Kyber and can only be decrypted by authorized nodes.

  • ๐Ÿ“Š Adaptive Monitoring
    Interactive dashboard with real-time visualization of entropy, latency, authentication, and events.


๐Ÿ“ฆ Objective

To offer a lightweight, auditable, and ready-to-use library for integrating quantum security with decentralized networks like Bit512.

Inspired by the PQClean project and integrated with anonymity technologies like Obfs4, WireGuard, and PySocks.


๐Ÿ” Supported Algorithms and Technologies

๐Ÿ“„ pqbit/simulation.py
โœ… Integrated with __init__.py and test_repository.py
๐Ÿง  Simulates key generation, encapsulation, and decapsulation using secrets.token_bytes()

  • Kyber1024 โ€” Quantum-resistant KEM
  • Dilithium5 โ€” High-security post-quantum digital signatures
  • Falcon1024 โ€” Compact and efficient signatures for restricted environments
  • Obfs4 โ€” Traffic cloaking for anonymous networks
  • WireGuard โ€” Lightweight and secure VPN
  • PySocks โ€” SOCKS proxy for flexible traffic routing
  • PQClean โ€” Clean C implementations for post-quantum security
  • Wireshark (via PyShark) โ€” Deep packet inspection and live traffic analysis

๐Ÿ“ Module Overview

โœ… benchmark.py

Performance tests for cryptographic operations and network latency.

โœ… benchmark_routes.py

Benchmarks across multiple routing paths, measuring entropy and cloaking.

โœ… dilithium.py

Post-quantum digital signatures using Dilithium5.

โœ… falcon.py

Compact and efficient signatures with Falcon1024.

โœ… guardian.py

Node validation, audit logging, and peer authentication.

โœ… __init__.py

Centralized imports, versioning, and API exposure.

โœ… kyber.py

Quantum-resistant key encapsulation with Kyber1024.

โœ… log_benchmark.py

Structured logging of benchmark results and metrics.

โœ… log_viewer.py

Real-time visualization of logs: latency, entropy, and events.

โœ… mesh.yaml

Network topology configuration for mesh routing.

โœ… obfs4.py

Traffic cloaking via obfs4proxy, with port and cert support.

โœ… pqclean.py

Integration with PQClean C implementations via ctypes.

โœ… pysocks.py

SOCKS proxy setup for flexible routing and anonymity.

โœ… report.py

Audit reports and peer validation summaries.

โœ… tunnel.py

WireGuard tunnel lifecycle management and config validation.

โœ… verifier.py

Signature verification and peer identity checks.

โœ… wg-meshconf.py

Generates WireGuard mesh configs from mesh.yaml.

โœ… wireguard.py

Low-level WireGuard interface and tunnel orchestration.

โœ… wireshark.py

Packet capture and analysis using PyShark and Scapy.


๐Ÿ“ฆ Installation

pip install pqbit

๐Ÿค Contributing

Contributions are welcome! Fork the repository, open issues, and submit pull requests to help evolve Bit512.


๐Ÿ“œ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿ™ Gratitude

This project is dedicated to the Python community and to those who believe in digital freedom.


---

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

pqbit-1.0.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pqbit-1.0.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file pqbit-1.0.0.tar.gz.

File metadata

  • Download URL: pqbit-1.0.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pqbit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a693b7f1b611ce1887271b0d6f771a868a5fe51d269eccf591089ffaa7772330
MD5 59f27c6e9787441a39245fb4d6de7853
BLAKE2b-256 d63b496bf7433076a83e9e5515e9fc835ff2b659f5aff772235f9585ebda2f92

See more details on using hashes here.

File details

Details for the file pqbit-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pqbit-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pqbit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00893039cb5b5ca42ba1a6ae856aea4b2bec4e7a31e52931d04d8505e8fbf9ad
MD5 5495231e77a281a06333912e23d9c60a
BLAKE2b-256 0162ef04e17075a65286e580e321f3afc844c895792bb3dc65ae4b7fdf5858a5

See more details on using hashes here.

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