Skip to main content

Post-quantum cryptography for Python: ML-KEM, ML-DSA, SLH-DSA, and hybrid encryption

Project description

QyberSafe

Build status PyPI License C++17 Python 3.9+ Platforms NIST FIPS PRs welcome

QyberSafe

QyberSafe is a modern C++ and Python library for integrating post-quantum cryptography into real applications. It provides modular, crypto-agile primitives for quantum-resistant key exchange, digital signatures, and hybrid encryption, built for fintech, cloud, and enterprise systems that need to stay secure against future quantum attacks.

Classical algorithms such as RSA and ECC are vulnerable to large-scale quantum computers. QyberSafe implements the NIST-standardized lattice and hash based schemes so you can defend against "harvest now, decrypt later" attacks today, with an API designed to swap algorithms as standards evolve.

Status: 0.1.0 alpha. The API is stabilizing and not yet recommended for production deployments.

Features

  • One small, misuse-resistant API: seal / open for encryption, sign / verify for signatures
  • First-class C++17 and Python, sharing a single audited core (liboqs)
  • NIST-standardized algorithms: ML-KEM (FIPS 203), ML-DSA (FIPS 204), and SPHINCS+ / SLH-DSA (FIPS 205 family)
  • Hybrid encryption by default: X25519 combined with ML-KEM-768, so confidentiality holds even if one half is broken
  • Self-describing, versioned key and ciphertext formats for crypto agility
  • Authenticated encryption (AES-256-GCM) with optional associated data
  • Security-focused: audited primitives, secure memory zeroing, no homemade cryptography
  • Continuous integration on Linux and macOS, including an AddressSanitizer/UBSan build

Algorithms

Algorithm (alias) Type NIST standard Parameter sets
ML-KEM (Kyber) Key encapsulation FIPS 203 ML-KEM-512 / 768 / 1024
ML-DSA (Dilithium) Signature FIPS 204 ML-DSA-44 / 65 / 87
SPHINCS+ (SLH-DSA) Hash-based signature FIPS 205 family SPHINCS+-SHA2-128s / 192s / 256s
Hybrid Classical + PQC - X25519 + ML-KEM-768 + AES-256-GCM

Parameter sets map to roughly 128, 192, and 256 bit security. The defaults (ML-KEM-768, ML-DSA-65) suit most workloads.

The hash-based signatures currently use liboqs' SPHINCS+-SHA2 "simple" parameter sets (the NIST round-3 submission that FIPS 205 SLH-DSA is based on). The FIPS-205 "pure" variant will be adopted once it verifies across all supported platforms in liboqs.

Installation

Python

Prebuilt wheels (no compiler required) are published for Linux, macOS (Apple Silicon), and Windows on CPython 3.9 to 3.13:

pip install qybersafe

On other platforms pip builds from the source distribution, which needs a C++17 compiler and OpenSSL (liboqs is fetched automatically).

C++

Requirements: a C++17 compiler (GCC 11+, Clang, or MSVC), CMake 3.16+, and OpenSSL. liboqs is fetched and built automatically.

git clone https://github.com/Nathandona/QyberSafe.git
cd QyberSafe
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure

The C++ headers and library install with cmake --install build.

Quick start

C++

#include <qybersafe/qybersafe.h>

using namespace qybersafe;

int main() {
    // Hybrid encryption (X25519 + ML-KEM-768)
    auto enc = generate_encryption_keypair();
    bytes message = {'h', 'e', 'l', 'l', 'o'};
    bytes envelope = seal(enc.public_key, message);
    bytes recovered = open(enc.private_key, envelope);

    // Signatures (ML-DSA-65 by default)
    auto signer = generate_signing_keypair();
    bytes signature = sign(signer.private_key, message);
    bool valid = verify(signer.public_key, message, signature);

    return (recovered == message && valid) ? 0 : 1;
}

Python

import qybersafe as qs

# Hybrid encryption, with optional associated data
enc = qs.generate_encryption_keypair()
envelope = qs.seal(enc.public_key, b"Hello, post-quantum world!", aad=b"context")
assert qs.open(enc.private_key, envelope, aad=b"context") == b"Hello, post-quantum world!"

# Signatures (ML-DSA-65 by default)
signer = qs.generate_signing_keypair()
signature = qs.sign(signer.private_key, b"message")
assert qs.verify(signer.public_key, b"message", signature)

Operations raise CryptoError on failure; verify returns a bool. Keys are opaque objects that serialize with to_bytes() / from_bytes().

Why post-quantum

A sufficiently powerful quantum computer running Shor's algorithm would break the public-key cryptography that secures most of the internet today. Attackers can already record encrypted traffic now and decrypt it later once such hardware exists, which is why long-lived secrets need quantum-resistant protection immediately. QyberSafe lets you adopt NIST PQC standards incrementally through hybrid modes, keeping classical guarantees while adding a post-quantum layer.

Roadmap

  • Additional language bindings (Go, Rust, JavaScript and WebAssembly)
  • TLS and SSH hybrid protocol modules
  • Hardware security module (HSM) integration
  • Hardware acceleration and SIMD optimizations
  • Benchmark suite and formal verification of critical components

See CHANGELOG.md for release history.

Documentation

The design and wire formats are documented in SPEC.md. The test suites are usable as examples: src/tests for C++ and python/tests for Python. API reference can be generated with Doxygen via cmake --build build --target docs.

Contributing

Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request, and file an issue for bugs, integration questions, or feature requests.

Security

QyberSafe is alpha software and has not undergone an independent security audit. Do not rely on it to protect production secrets yet. Report vulnerabilities privately through GitHub Security Advisories rather than through public issues.

License

Released under the MIT License.

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

qybersafe-0.1.0a4.tar.gz (194.2 kB view details)

Uploaded Source

Built Distributions

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

qybersafe-0.1.0a4-cp313-cp313-win_amd64.whl (11.2 MB view details)

Uploaded CPython 3.13Windows x86-64

qybersafe-0.1.0a4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

qybersafe-0.1.0a4-cp313-cp313-macosx_11_0_arm64.whl (11.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

qybersafe-0.1.0a4-cp312-cp312-win_amd64.whl (9.4 MB view details)

Uploaded CPython 3.12Windows x86-64

qybersafe-0.1.0a4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

qybersafe-0.1.0a4-cp312-cp312-macosx_11_0_arm64.whl (9.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

qybersafe-0.1.0a4-cp311-cp311-win_amd64.whl (7.6 MB view details)

Uploaded CPython 3.11Windows x86-64

qybersafe-0.1.0a4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

qybersafe-0.1.0a4-cp311-cp311-macosx_11_0_arm64.whl (7.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

qybersafe-0.1.0a4-cp310-cp310-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.10Windows x86-64

qybersafe-0.1.0a4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

qybersafe-0.1.0a4-cp310-cp310-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

qybersafe-0.1.0a4-cp39-cp39-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.9Windows x86-64

qybersafe-0.1.0a4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

qybersafe-0.1.0a4-cp39-cp39-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file qybersafe-0.1.0a4.tar.gz.

File metadata

  • Download URL: qybersafe-0.1.0a4.tar.gz
  • Upload date:
  • Size: 194.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qybersafe-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 afe36aade2477c83f0004c21cd99a8c21e53dad7c55e32cf0ac6582aa9b84f01
MD5 f3f41921355ec7495d0a4a79a726e0de
BLAKE2b-256 0a3dd32e773df8d372b86d3a87de1533dfcd185799e8258fae3143c8ea10d8e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4.tar.gz:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: qybersafe-0.1.0a4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 11.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qybersafe-0.1.0a4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 25e68adf1678f0996ba06f62b032793457ecbb4baa1a827bd0c02e0b140c6a06
MD5 4d11ff713e0c5bab139aa289d5af34da
BLAKE2b-256 b2396c624ef203e134db684e59beb054ec46a00272cf871482901b5c4847ba56

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp313-cp313-win_amd64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f3b9e4e2116b07b53c3cf3053eef2e68e1690e990b3f0cc5f47888f35427fd9a
MD5 1f069f6b4ad21d63f76c8266727cbfc1
BLAKE2b-256 aad4dfe44c119b50438614d8028c759c9d9278a95e1637ba2fcc1687b94ac01b

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6055baf51c7f881c7731e828ec54f13b1c76d44eefeec2775387ef0b98025a46
MD5 de0fc2eed125bfba372d6256aa9f2e17
BLAKE2b-256 f9990d0dcb891dd06c5666f1b205511cec63c3a884bc43d3a48abdd96e4fc2d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3c8d6cc0a3fc3672a5a28c4de9d441e5899bd087640cdd7aed0b3c09938e8c5b
MD5 a47846848a09384a177aa40eddf01149
BLAKE2b-256 c4fb1aa31905c83eb5fa173156f7a0abf1b3ec070e8dc3f9ce91a634aadba8cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f4188253146bb3664d36d8ed6491e0c055bcc51a7b694ddd6db6a9ef55333ef4
MD5 4ed5d5abcaa9488325c1b4bebdbd89ff
BLAKE2b-256 de2c2575df882c0c804112b1ebc16881ca992e168d4bfcfad1a383c75450e3ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9846f060d8e37508465bc78aeb17ccc42a56e6b6658d727a625eb31d716ec7b
MD5 ef146dc3784a9ce80dd2b75ee71bfa1b
BLAKE2b-256 a1731b3d0fb0b75bb9fe161fa4eafb00e0c74af2b9f1f60e992b4806abb55a4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f04105c3d30cea4e02d786e80aa1f05a6e9175ef2121ae73b50995336aa076b1
MD5 818aa95ec3932a064e63ea23ecd896f9
BLAKE2b-256 5ff008adadd5518966ca94714677953da42c18eedb5dc74bfda0fa0e3a6ce8b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp311-cp311-win_amd64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 054a8e5fd3f8361a82d84489fa4ec3264811fde46d0164a7d3fe391080c1527c
MD5 8bcd9a49f9a7e6f5c3cea450fd861ff1
BLAKE2b-256 c3be634e3d3acd42b5c255cdfe80fe3335791d4f005f0b54013e2b60e7161bd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0233a74b1ed42d2b28e72baf34fea2aa1b28f2992cce064449fc7f53fab88a4a
MD5 fbcd4d22153f9f3f82661f85f0e4fc8a
BLAKE2b-256 ac570284bbecd1d8f1b71af11719fc3d32414f092ca1dcb0a3b702a02107c34b

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0d326c93081cfb77c805a6b59d70f701d9ad5dac0ef782bef51adeb50572792f
MD5 ed45e7279eb0910d57447e9829a589e0
BLAKE2b-256 c7ebc96d6c8d060914a501f4423f50dc7419b822194a4e8199ad67edf77e232e

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 01cfbb5187a26dd41dd7d2f487297184fd20aaec7425e471565a32029e2bffe8
MD5 a41ce1a279e169c111af9aa99b1239ec
BLAKE2b-256 dfdc743a449e67d50143fe30c9aa223ef48feaf0af548cccd677b5ec80f3310f

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f489c5eb3b5a13c76859e993a8a85758a68508e0b047f6594764af7e1be2a54
MD5 9feef4c535baee805d9891d33ce84c06
BLAKE2b-256 dabb8a4cc02022e98da1c1b890ac511198b680590340064489ef1e2d3fdaf469

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: qybersafe-0.1.0a4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qybersafe-0.1.0a4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f22ecfdd0f01f9920ed1d489b6f77ef630bf58113a1ac5858384fcf6596e19cf
MD5 474bb0f0b6ed64df8c64f67a971e4b6a
BLAKE2b-256 dff6d7576fda64379429ba26f3548ab5117d671482836faddaf3c3d50fb97628

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp39-cp39-win_amd64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2156b3e55576967b6a79b051d5d7d5204aaf6e98c13ee9ef4826a403517cc80a
MD5 66737ac5474e3603bf290fd4a6ca3945
BLAKE2b-256 d5516f697bd4da66a4cd3a4a763400565720fa0a5c93ace73b01daf536b0c5b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qybersafe-0.1.0a4-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qybersafe-0.1.0a4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d75d9c78cf6c7e1f271eb437e47f25b662ec02bd7372c11e181fa528060b53b0
MD5 4c2e9494f310cd3c2cb05542fb38af75
BLAKE2b-256 d9fe0e0fa34d6112ccdc5e263f6c43e7d52eb8d27586210ab89be53764fe7c89

See more details on using hashes here.

Provenance

The following attestation bundles were made for qybersafe-0.1.0a4-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Nathandona/QyberSafe

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