File: README.md

package info (click to toggle)
python-mceliece 0~20241009.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 204 kB
  • sloc: python: 491; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 815 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Python wrapper around [mceliece](https://lib.mceliece.org) library,
wrapper around the Classic McEliece cryptosystem.

To access the Python functions provided by mceliece, import the library (for, e.g., mceliece6960119):

    from mceliece import mceliece6960119

To generate a key pair:

    pk,sk = mceliece6960119.keypair()

To generate a ciphertext c encapsulating a randomly generated session key k:

    c,k = mceliece6960119.enc(pk)

To recover a session key from a ciphertext:

    k = mceliece6960119.dec(c,sk)

As a larger example, the following test script creates a key pair, creates a ciphertext and session key, and then recovers the session key from the ciphertext:

    import mceliece
    kem = mceliece.mceliece6960119
    pk,sk = kem.keypair()
    c,k = kem.enc(pk)
    assert k == kem.dec(c,sk)