{"id":21629710,"url":"https://github.com/harryr/pypqc","last_synced_at":"2025-10-09T20:42:27.831Z","repository":{"id":139181355,"uuid":"133964284","full_name":"HarryR/PyPQC","owner":"HarryR","description":"Python Wrappers for Post-Quantum Cryptography, see: https://csrc.nist.gov/Projects/Post-Quantum-Cryptography/Round-1-Submissions","archived":false,"fork":false,"pushed_at":"2018-06-24T10:45:01.000Z","size":148,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T14:13:06.754Z","etag":null,"topics":["cli","cryptography","nist","post-quantum","post-quantum-cryptography","python"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HarryR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2018-05-18T14:20:52.000Z","updated_at":"2022-07-29T13:15:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3dd23df-6c43-49ae-988e-a6139317af54","html_url":"https://github.com/HarryR/PyPQC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HarryR/PyPQC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryR%2FPyPQC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryR%2FPyPQC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryR%2FPyPQC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryR%2FPyPQC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarryR","download_url":"https://codeload.github.com/HarryR/PyPQC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryR%2FPyPQC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001981,"owners_count":26083259,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","cryptography","nist","post-quantum","post-quantum-cryptography","python"],"created_at":"2024-11-25T02:08:32.764Z","updated_at":"2025-10-09T20:42:27.814Z","avatar_url":"https://github.com/HarryR.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyPQC - Python Post-Quantum Cryptography Wrappers\n\nThis project provides Python and command-line wrappers for the NIST Post-Quantum Cryptography submissions, see: https://csrc.nist.gov/Projects/Post-Quantum-Cryptography/Round-1-Submissions \n\nIt serves to make the Round 1 submissions more accessible to developers, and should allow you to experiment and prototype with them very quickly in Python or other languages, without having to write C code, create shared objects or DLLs or lock yourself into one specific algorithm (e.g. when Round 2 happens).\n\n\n## Build\n\n[![Build Status](https://travis-ci.org/HarryR/PyPQC.svg?branch=master)](https://travis-ci.org/HarryR/PyPQC)\n\nRequired packages:\n\n  * `openssl-devel` or `libssl-dev` to get `libcrypto.so`\n\nThen build with:\n\n```\nmake\n```\n\n## Example\n\nThe two classes, `PQCKEM` and `PQCSign`, provide an interface to the `pqc_cli` executable. You must provide it with the full path of the executable as the constructor argument. Each submission is modified slightly to build its own `pqc_cli` executable.\n\nIf the algorithm supports both Key Exchange and Signing, it's not guaranteed that key pairs generated for one are compatible with the other.\n\n\n### Key Exchange\n\nCreates a shared secret for the owner of a designated key pair. Only the holder of the secret component of the key pair can decode the shared secret from the cipher text.\n\nThe shared secret is randomly generated, the `encaps` method returns the cipher text and the shared secret. Pass the cipher text to the key pair owner. They can then decrypt the cipher text by providing their secret key, resulting in the same shared secret.\n\n```\nx = PQCKEM(kem_path)\npk, sk = x.keypair()\nct, ss = x.encaps(pk)\ncheck_ss = x.decaps(ct, sk)\nassert ss == check_ss\n```\n\n### Message Signing\n\nAllows the owner of a key pair to create a signed message which can only be opened if the decrypter knows the public key. An alternative interpretation is that with knowledge of a public key the authenticity of a signed message can be verified as having been created by the holder of the secret key.\n\n```\nx = PQCSign(sign_path)\npk, sk = x.keypair()\nmsg = os.urandom(128)\nsmsg = x.sign(sk, msg)\ncmsg = x.open(pk, smsg)\nassert msg == cmsg\n```\n\n## Supporting Additional Algorithms\n\nThe `pqc_cli_api.c` file provides a consistent interface to the native code, this is the entry point for the `pqc_cli` executable and links against the source code for the algorithm.\n\nTo add support for an additional algorithm, follow these steps:\n\n 1. Download and extract the submission into the same directory as this projects source code\n 2. Symlink `pqc_cli_api.c` into the source directory\n 3. Modify the Makefile to build `pqc_cli_api.c` as `pqc_cli`\n 4. Define `-DBUILD_KEM` or `-DBUILD_SIGN` or both, when compiling `pqc_cli_api.c` to turn-on the CLI API for those features.\n 5. Add the path of the resulting `pqc_cli` file to `pqcalgos.py`\n\n\n## Notes\n\n * https://cryptojedi.org/peter/data/nancy-20180219.pdf (Peter Schwabe)\n * https://csrc.nist.gov/CSRC/media/Presentations/PostQuantum-RSA/images-media/PostQuantumRSA-April2018.pdf\n\n\n## Talking Points\n\nFrom a [recent slashdot article](https://it.slashdot.org/story/18/05/19/200225/ibm-warns-quantum-computing-will-break-encryption) \n\n\u003e \"What I wonder is, if encryption can be 'instantly broken,' does this also mean that remaining crypto-coins can be instantly discovered?\"\n\nThe following whitepaper attempts to answer some of these questions: https://github.com/theQRL/Whitepaper/blob/master/QRL_whitepaper.pdf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharryr%2Fpypqc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharryr%2Fpypqc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharryr%2Fpypqc/lists"}