Skip to main content

Python bindings for NIST-standardized post-quantum cryptography, powered by OpenSSL. Honoring Alkindi, the 9th-century pioneer of cryptography.

Project description

Alkindi

In honor of Alkindi (الكِندي), the 9th-century pioneer of cryptography*

Status: Alpha License: Apache-2.0

High-performance Python bindings for NIST-standardized post-quantum cryptography, powered by OpenSSL.


Table of Contents


About

The project is named after Alkindi (الكِنْدي), the 9th-century Arab Muslim polymath who pioneered cryptanalysis and frequency analysis, laying the foundations for modern cryptography.

Alkindi makes quantum-resistant cryptography straightforward and accessible in Python by providing clean, type-safe bindings to OpenSSL's implementations of NIST-standardized post-quantum algorithms. As quantum computers advance, traditional public-key systems like RSA and elliptic curves become vulnerable. Alkindi provides the cryptographic primitives needed to protect against both classical and quantum attacks.

Supported Algorithms

  • ML-KEM (formerly Kyber) — Key encapsulation mechanisms for secure key exchange
    Based on lattice cryptography, ML-KEM enables two parties to establish a shared secret over an insecure channel. Available in three security levels (ML-KEM-512, ML-KEM-768, ML-KEM-1024) corresponding to AES-128, AES-192, and AES-256 equivalent security.

  • ML-DSA (formerly Dilithium) — Digital signatures for authentication and integrity
    Lattice-based signatures that provide quantum-resistant authentication. Three parameter sets (ML-DSA-44, ML-DSA-65, ML-DSA-87) offer balanced trade-offs between signature size and security strength.

  • SLH-DSA (formerly SPHINCS+) — Hash-based signatures for conservative security guarantees
    Unlike lattice-based schemes, SLH-DSA relies only on hash function security, making it ideal for long-term signatures and applications requiring minimal cryptographic assumptions. Available in multiple variants optimized for either speed or size.

Alkindi uses CFFI to interface directly with OpenSSL's C implementations, achieving high performance with minimal overhead. The library provides a stateless, thread-safe API with full type annotations for enhanced developer experience.

Status: Alpha — Alkindi is under active development with the explicit goal of becoming a production-grade, thoroughly reviewed PQC library for Python. APIs may change before version 1.0.0.


Why Alkindi?

Alkindi bridges the gap between enterprise-grade cryptography and Python developer ergonomics, bringing NIST-standardized post-quantum algorithms to your applications with production readiness in mind:

Feature Description
Battle-tested backend Built on OpenSSL, leveraging decades of cryptographic engineering and security audits rather than implementing algorithms from scratch.
Standards-first Uses NIST-standardized post-quantum algorithms exclusively and avoids experimental or pre-standard variants.
High performance CFFI-based bindings call OpenSSL directly, achieving near-native C performance with minimal Python overhead.
Type-safe, simple API Full type hints and a stateless, thread-safe design for safer concurrent usage and superior developer experience.
Minimal attack surface A deliberately focused API that is easier to reason about, audit, and review than a sprawling cryptographic toolkit.

Installation

From PyPI (Coming Soon)

pip install alkindi

From Source

Requirements: Python 3.10+ and C compiler

# Clone the repository
git clone https://github.com/alraddady/alkindi.git
cd alkindi

# Build OpenSSL with PQC support
./scripts/build_openssl.sh

# Install Alkindi
pip install -e .

# Or install with development dependencies
pip install -e ".[dev]"

Quick Start

Key Encapsulation (ML-KEM)

ML-KEM enables two parties to establish a shared secret over an insecure channel. The sender encapsulates a secret into a ciphertext using the receiver's public key, and the receiver decapsulates it to recover the same secret.

from alkindi import KEM

# Generate a keypair for the receiver
keypair = KEM.generate_keypair("ML-KEM-768")

# Sender: encapsulate a shared secret
ciphertext, shared_secret_sender = KEM.encapsulate("ML-KEM-768", keypair.public_key)

# Receiver: decapsulate to recover the shared secret
shared_secret_receiver = KEM.decapsulate("ML-KEM-768", keypair.private_key, ciphertext)

# Both parties now share the same secret
assert shared_secret_sender == shared_secret_receiver

Digital Signatures (ML-DSA)

ML-DSA provides digital signatures for authentication and message integrity. A signer uses their private key to sign messages, and verifiers use the corresponding public key to confirm authenticity.

from alkindi import Signature

# Generate a keypair for the signer
keypair = Signature.generate_keypair("ML-DSA-65")

# Sign a message
message = b"Hello, quantum world!"
signature = Signature.sign("ML-DSA-65", keypair.private_key, message)

# Verify the signature
is_valid = Signature.verify("ML-DSA-65", keypair.public_key, message, signature)
print(f"Signature valid: {is_valid}")  # True

# Tampering detection
is_valid = Signature.verify("ML-DSA-65", keypair.public_key, b"Tampered message", signature)
print(f"Tampered signature valid: {is_valid}")  # False

Documentation

Algorithm Selection Guide

Choosing the right algorithm and parameter set depends on your security requirements, performance constraints, and use case. For detailed guidance on selecting appropriate algorithms, see the Algorithm Selection Guide.

NIST Standards

Additional Resources


Contributing

Contributions are welcome! Please review our Contributing Guidelines before submitting pull requests or opening issues.


License

Licensed under the Apache License 2.0. See LICENSE for complete terms.


Acknowledgments

Alkindi stands on the shoulders of giants. I would like to thank the following organizations and teams for their foundational work:

  • National Institute of Standards and Technology (NIST): for standardizing post-quantum cryptography
  • OpenSSL Project: for providing the cryptographic foundation
  • Algorithm Development Teams:
    • Kyber developers
    • Dilithium developers
    • SPHINCS+ developers
  • Open Quantum Safe (OQS): for their pioneering work in making post-quantum cryptography practical and for fostering a welcoming community

My sincere gratitude also extends to the broader open-source community, whose collaborative spirit and tireless contributions make projects like this possible.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

alkindi-0.0.1-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

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

alkindi-0.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

alkindi-0.0.1-cp313-cp313-macosx_14_0_arm64.whl (967.2 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

alkindi-0.0.1-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

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

alkindi-0.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

alkindi-0.0.1-cp312-cp312-macosx_14_0_arm64.whl (967.2 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

alkindi-0.0.1-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

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

alkindi-0.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

alkindi-0.0.1-cp311-cp311-macosx_14_0_arm64.whl (967.1 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

alkindi-0.0.1-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

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

alkindi-0.0.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

alkindi-0.0.1-cp310-cp310-macosx_14_0_arm64.whl (967.1 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file alkindi-0.0.1-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5801c25a4817ff23cda766469fa9ce28497154835b00c7482fcbbc98c4ce8140
MD5 d090142257d8c1c0d6c87e0d26bcd54f
BLAKE2b-256 c99ae7fbeb523cb2dcdc3c25c76d2063e647d7221d19018beaee6b652be52c1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9186787197fb89528e27a69b3c36d973fd0f2582d06f40fb72a5058363d72648
MD5 6dfce8abec293e2f059e084df84b00c7
BLAKE2b-256 731727c37fe567003411092728cf2b527523cdb5c100b2dd503943fb4fec77d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 aad1e72756de7443584e03ba6f4796dfa688cad350fe7a4555a62364a229dd52
MD5 02d455947722005b5951873e06917b52
BLAKE2b-256 76a9a11ddf4de7228dc056f38b8a0d4c90452ca3dfb3b1801e38abf330f4825d

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a88b06679f4045e3ff4a4016ae01ea797f74ec6957eca62e75c6eafdd479801f
MD5 140ea19cdba9aedde80c6f30f4865ce2
BLAKE2b-256 33ef664c2243974db159b344ea68afde04995b3ccf58e15ecf7e7ca958e2b76a

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5c2725877a114b65d8fc2d191fc28443edc51a5a98a07ec7e82915dcaf41aa8a
MD5 55571df9d0c4278cb2b4073637bc2f16
BLAKE2b-256 959fa4b1fdb7c610c503585cd099df553d45bf4e463d393c9f9b1da0c4807fc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 fd4daded7b1b8632e1073a12532d624c9367f8b467f8915e6e800ab2f72a4784
MD5 159bc51e5b0ae23b6854a2b2dbde48f6
BLAKE2b-256 903e0c10d860817ad3a0b57a5c0b93f7d8927785568b0164cfc9cecca36a53b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 27b4453f2a85774ce832662e78872a4e034f393692fabb6bc12d18e2f4053e10
MD5 770c0fd5dc121dcd8891ea8dc17a8b0e
BLAKE2b-256 99c6a2cb9093279af9e3a4951d04bc50fc82cfb13ea7baf643beb9ba05318ade

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 27e59a93569d2bf87a1bade994ccb873bd414d0b6d2bc11b5fc3a1eb29e1299b
MD5 7a7ae6c7228c36c433382982a8c6b6cf
BLAKE2b-256 57f31e8b9021f4bd3bb0d96cc432efd6fd1c90332fead419b2a45e23a851cca7

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9b7d590132ccb8b1ecbeab945666a9707e4faa75c29f4db06792f35a78a0893c
MD5 fb0918ba4f7527ab60e0430b016d8b03
BLAKE2b-256 4957b8687b08703410cda27d822fb6a20deb85bf94bba4cc18d072c9bb180b7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30c61cd584f87dfcbd144f582bd9708a06948c72c2f147fe54056b2a5089ea3b
MD5 6f039383500ca9737f3153321a2ce263
BLAKE2b-256 538a483083f99c7c19dd0b8c53dff80ea9b386ce5f4158468eb6c1b5bd942446

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e2ac952e74227d408b346d02e97c35e00cf5c7f31f06a323f4b1d7a817982132
MD5 d6c43d60c6d1214c30bf319bf26f0532
BLAKE2b-256 10594b6f5c5abd1b002506a0538687ed3641d0815504dd8cb5099afa27cb39a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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

File details

Details for the file alkindi-0.0.1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for alkindi-0.0.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 303a8ab92460dc28ac86392cf85b60e623d30a864092fe27ead74e519c754045
MD5 a781456885f405238c6e3436b0449104
BLAKE2b-256 bec66bf38d5b9fc7a015484fc84fd70bfabdf6c8b8ee7ca8b83fec123b2c3d7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for alkindi-0.0.1-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: python-publish.yml on alraddady/alkindi

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