{"id":27972861,"url":"https://github.com/backbone-hq/pqcrypto","last_synced_at":"2025-05-07T23:20:12.499Z","repository":{"id":44882155,"uuid":"293383529","full_name":"backbone-hq/pqcrypto","owner":"backbone-hq","description":"👻 Post-quantum cryptography for Python.","archived":false,"fork":false,"pushed_at":"2025-04-30T20:21:27.000Z","size":95,"stargazers_count":65,"open_issues_count":4,"forks_count":23,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-30T20:35:29.623Z","etag":null,"topics":["cryptography","key-exchange","post-quantum-cryptography","public-key-cryptography","python","signature-scheme"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/backbone-hq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-09-07T00:14:24.000Z","updated_at":"2025-04-30T20:06:16.000Z","dependencies_parsed_at":"2025-04-20T07:51:49.237Z","dependency_job_id":null,"html_url":"https://github.com/backbone-hq/pqcrypto","commit_stats":null,"previous_names":["kpdemetriou/pqcrypto"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backbone-hq%2Fpqcrypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backbone-hq%2Fpqcrypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backbone-hq%2Fpqcrypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backbone-hq%2Fpqcrypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backbone-hq","download_url":"https://codeload.github.com/backbone-hq/pqcrypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968718,"owners_count":21833344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","key-exchange","post-quantum-cryptography","public-key-cryptography","python","signature-scheme"],"created_at":"2025-05-07T23:20:11.604Z","updated_at":"2025-05-07T23:20:12.477Z","avatar_url":"https://github.com/backbone-hq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![PQCrypto](https://github.com/backbone-hq/pqcrypto/blob/master/media/pqcrypto.png?raw=true)\n\n![PyPI Version](https://img.shields.io/pypi/v/pqcrypto)\n![Build Status](https://img.shields.io/github/actions/workflow/status/backbone-hq/pqcrypto/ci.yml?branch=master)\n![GitHub License](https://img.shields.io/github/license/backbone-hq/pqcrypto)\n![Python Version](https://img.shields.io/pypi/pyversions/pqcrypto)\n\n# 👻 Post-Quantum Cryptography\n\nIn recent years, there has been a substantial amount of research on quantum computers – machines that exploit quantum mechanical phenomena to solve mathematical problems that are difficult or intractable for conventional computers. If large-scale quantum computers are ever built, they will be able to break many of the public-key cryptosystems currently in use. This would seriously compromise the confidentiality and integrity of digital communications on the Internet and elsewhere. The goal of post-quantum cryptography (also called quantum-resistant cryptography) is to develop cryptographic systems that are secure against both quantum and classical computers, and can interoperate with existing communications protocols and networks.\n\n## 🎯 Purpose\n\nPQCrypto provides tested, ergonomic **Python 3** CFFI bindings to implementations of quantum-resistant cryptographic algorithms that were submitted to the [NIST Post-Quantum Cryptography Standardization](https://csrc.nist.gov/projects/post-quantum-cryptography/post-quantum-cryptography-standardization) process.\n\nThis library focuses exclusively on post-quantum cryptography for Python, adhering to the Unix philosophy of doing one thing well. The cryptographic primitives are designed to be composable with existing cryptographic libraries, enabling simple integration of post-quantum cryptography into existing applications without sacrificing security or performance.\n\n## 💾 Installation\n\nYou can install PQCrypto using your package manager of choice.\nPre-compiled wheels are available for common platforms and Python versions.\n\nUsing `uv`:\n```bash\nuv add pqcrypto\n```\n\nUsing `poetry`:\n```bash\npoetry add pqcrypto\n```\n\nUsing `pip`:\n```bash\npip install pqcrypto\n```\n\n## 🔐 Key Encapsulation\n\nA Key Encapsulation Mechanism (KEM) is a cryptographic primitive used to securely establish a shared secret key between two parties over an insecure channel. Unlike traditional asymmetric encryption, which focuses on encrypting arbitrary messages, a KEM is specifically designed for the secure transmission of symmetric keys.\n\n```python\nfrom secrets import compare_digest\nfrom pqcrypto.kem.mceliece8192128 import generate_keypair, encrypt, decrypt\n\n# Alice generates a (public, secret) key pair\npublic_key, secret_key = generate_keypair()\n\n# Bob derives a secret (the plaintext) and encrypts it with Alice's public key to produce a ciphertext\nciphertext, plaintext_original = encrypt(public_key)\n\n# Alice decrypts Bob's ciphertext to derive the now shared secret\nplaintext_recovered = decrypt(secret_key, ciphertext)\n\n# Compare the original and recovered secrets in constant time\nassert compare_digest(plaintext_original, plaintext_recovered)\n```\n\n## ✒️ Signing\n\nDigital signatures are cryptographic mechanisms that provide authentication, non-repudiation, and integrity to digital messages or documents. They allow the recipient to verify that a message was created by a known sender and hasn't been altered during transmission.\n\n```python\nfrom pqcrypto.sign.sphincs_shake_256s_simple import generate_keypair, sign, verify\n\n# Alice generates a (public, secret) key pair\npublic_key, secret_key = generate_keypair()\n\n# Alice signs her message using her secret key\nsignature = sign(secret_key, b\"Hello world\")\n\n# Bob uses Alice's public key to validate her signature\nassert verify(public_key, b\"Hello world\", signature)\n```\n\n## 📋 Available Algorithms\n\n### Key Encapsulation Mechanisms\n\n```\n- hqc_128\n- hqc_192\n- hqc_256\n- mceliece348864\n- mceliece348864f\n- mceliece460896\n- mceliece460896f\n- mceliece6688128\n- mceliece6688128f\n- mceliece6960119\n- mceliece6960119f\n- mceliece8192128\n- mceliece8192128f\n- ml_kem_1024\n- ml_kem_512\n- ml_kem_768\n```\n\n### Signature Algorithms\n\n```\n- falcon_1024\n- falcon_512\n- falcon_padded_1024\n- falcon_padded_512\n- ml_dsa_44\n- ml_dsa_65\n- ml_dsa_87\n- sphincs_sha2_128f_simple\n- sphincs_sha2_128s_simple\n- sphincs_sha2_192f_simple\n- sphincs_sha2_192s_simple\n- sphincs_sha2_256f_simple\n- sphincs_sha2_256s_simple\n- sphincs_shake_128f_simple\n- sphincs_shake_128s_simple\n- sphincs_shake_192f_simple\n- sphincs_shake_192s_simple\n- sphincs_shake_256f_simple\n- sphincs_shake_256s_simple\n```\n\n\n## 🙏 Credits\n\nThe C implementations used herein are derived from the [PQClean](https://github.com/pqclean/pqclean/) project.\n\n---\n\nBuilt with ❤️ by [Backbone](https://backbone.dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackbone-hq%2Fpqcrypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackbone-hq%2Fpqcrypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackbone-hq%2Fpqcrypto/lists"}