Skip to main content

No project description provided

Project description

Installation

(Installation instructions TODO.)

Usage

from pqc.kem import mceliece6960119


# 1. Keypair generation
pk, sk = mceliece6960119.kem_keypair()

# WARNING these^ are some heavy keys
# (1MiB public, 13.6KiB private)
# if you must display them, consider base64.encode(...)


# 2. Key encapsulation
ss, kem_ct = mceliece6960119.kem_enc(pk)

# 2(a). Hybrid KEM-Wrap
cek = urandom(32)
symm_ct = MY_SYMMETRIC_CRYPTOSYSTEM.enc(message_plaintext, key=cek)
kek = MY_KDF(ss, target=MY_KEYWRAP)
wk = MY_KEYWRAP.enc(cek, key=kek)
SEND_MESSAGE([kem_ct, wk, symm_ct])


# 3. Key de-encapsulation
ss_result = mceliece6960119.kem_dec(kem_ct, sk)
assert ss_result == ss

# 3(a) Hybrid KEM Unwrap
kek = MY_KDF(ss_result, target=MY_KEYWRAP)
cek = MY_KEYWRAP.dec(wk, key=kek)
message_result = MY_SYMMETRIC_CRYPTOSYSTEM.dec(symm_ct, key=cek)

Currently, only the McEliece KEM is exposed. Kyber and HQC are planned next; after them will be the signature algorithms.

Capabilities not included in PQClean, such as McEliece signatures, Hybrid Encryption (depicted above), and message encapsulation, are not going to be implemented in this library. (Exception: Plaintext Confirmation is on the agenda for inclusion even if upstream ultimately decides to exclude it.)

Development

Dependencies:

Getting started:

  1. Maybe use a venv or whatever if you want to

    • for Windows: py -m venv .venv & .venv\Scripts\activate.bat

    • for Linux and Mac: python3 -m venv .venv; . .venv/bin/activate (first install it, if needed)

  2. Run python -m pip install .

    • Alternatively: you may get cleaner building with python -m build . (only after python -m pip install build)

    • Editable / “develop” mode not supported currently (CFFI will have to support this before it’s even on the table.)

  3. Run python -m pqc.demo to test it. If it prints “OK” and exits, the functions are almost certainly not broken. (Ideally, run this from a DIFFERENT directory, such as your home folder, so you can be sure it’s being imported properly and not being masked by the local copy.)

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

pypqc-0.0.1.tar.gz (1.5 MB view details)

Uploaded Source

File details

Details for the file pypqc-0.0.1.tar.gz.

File metadata

  • Download URL: pypqc-0.0.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pypqc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1738042c62d931c5ee6c953cf5fe6bf02d49d5c053b86264e643b6b3874b3b77
MD5 95b8c79a9d0b9006ab3ba1ff46f80f58
BLAKE2b-256 90c3be47ee5e3c24c41e7eeb58ce97c745650789c46dc5a9e6bda54e0293eebb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page