pymceliece


Namepymceliece JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryA Python wrapper for the libmceliece microlibrary
upload_time2023-10-10 08:14:32
maintainer
docs_urlNone
author
requires_python>=3.6
license
keywords post-quantum cryptography mceliece classic mceliece libmceliece pymceliece
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pymceliece
A Python wrapper for the libmceliece microlibrary

# Installation
## Dependencies
pymceliece depends only on libmceliece (which also depends on libcpucycles and
librandombytes), available [here](https://lib.mceliece.org)

# API
## Instantiated parameters
The API follows the libmceliece API. It implements the following parameter sets:

- mceliece8192128
- mceliece6960119
- mceliece6688128
- mceliece8192128
- mceliece460896
- mceliece348864
- mceliece6960119f
- mceliece6688128f
- mceliece8192128f
- mceliece460896f
- mceliece348864f

Each has the following constants defined:
- mceliecexxxxxxx.PUBLICKEYBYTES
Length of the public key
- mceliecexxxxxxx.SECRETKEYBYTES
Length of the private key
- mceliecexxxxxxx.CIPHERTEXTBYTES
Length of the ciphertext
- mceliecexxxxxxx.BYTES
Length of the session key

## Usage
For each instantiation the following functions are available:
### mcelieceXXXXXXX.keypair() -> Tuple[bytes, bytes]

Randomly generates a McEliece secret key and its corresponding public key.

Example:
```python
>>> from pymceliece import mceliece6960119
>>> pk, sk = mceliece6960119.keypair()
```

### mcelieceXXXXXXX.enc(pk: bytes) -> Tuple[bytes, bytes]
Randomly generates a ciphertext and the corresponding session key given a
public key pk.

Example:
```python
>>> from pymceliece import mceliece8192128f
>>> pk, _ = mceliece8192128f.keypair()
>>> c, k = mceliece8192128f.enc(pk)
```

### mcelieceXXXXXXX.dec(c: bytes, pk: bytes) -> bytes
Given a McEliece secret key sk and a ciphertext c encapsulated to sk's
corresponding public key pk, computes the session key k.

Example:
```python
>>> from pymceliece import mceliece348864f
>>> pk, sk = mceliece348864f.keypair()
>>> c, k = mceliece348864f.enc(pk)
>>> mceliece348864f.dec(c, sk) == k
True
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pymceliece",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "post-quantum,cryptography,McEliece,Classic McEliece,libmceliece,pymceliece",
    "author": "",
    "author_email": "Jonathan Levin <pymceliece@riseup.net>",
    "download_url": "https://files.pythonhosted.org/packages/69/12/7cf9c038c55f004a49a45e45ad05dbe1592acea0715bb025fb4d3627ed6a/pymceliece-0.0.1.tar.gz",
    "platform": null,
    "description": "# pymceliece\nA Python wrapper for the libmceliece microlibrary\n\n# Installation\n## Dependencies\npymceliece depends only on libmceliece (which also depends on libcpucycles and\nlibrandombytes), available [here](https://lib.mceliece.org)\n\n# API\n## Instantiated parameters\nThe API follows the libmceliece API. It implements the following parameter sets:\n\n- mceliece8192128\n- mceliece6960119\n- mceliece6688128\n- mceliece8192128\n- mceliece460896\n- mceliece348864\n- mceliece6960119f\n- mceliece6688128f\n- mceliece8192128f\n- mceliece460896f\n- mceliece348864f\n\nEach has the following constants defined:\n- mceliecexxxxxxx.PUBLICKEYBYTES\nLength of the public key\n- mceliecexxxxxxx.SECRETKEYBYTES\nLength of the private key\n- mceliecexxxxxxx.CIPHERTEXTBYTES\nLength of the ciphertext\n- mceliecexxxxxxx.BYTES\nLength of the session key\n\n## Usage\nFor each instantiation the following functions are available:\n### mcelieceXXXXXXX.keypair() -> Tuple[bytes, bytes]\n\nRandomly generates a McEliece secret key and its corresponding public key.\n\nExample:\n```python\n>>> from pymceliece import mceliece6960119\n>>> pk, sk = mceliece6960119.keypair()\n```\n\n### mcelieceXXXXXXX.enc(pk: bytes) -> Tuple[bytes, bytes]\nRandomly generates a ciphertext and the corresponding session key given a\npublic key pk.\n\nExample:\n```python\n>>> from pymceliece import mceliece8192128f\n>>> pk, _ = mceliece8192128f.keypair()\n>>> c, k = mceliece8192128f.enc(pk)\n```\n\n### mcelieceXXXXXXX.dec(c: bytes, pk: bytes) -> bytes\nGiven a McEliece secret key sk and a ciphertext c encapsulated to sk's\ncorresponding public key pk, computes the session key k.\n\nExample:\n```python\n>>> from pymceliece import mceliece348864f\n>>> pk, sk = mceliece348864f.keypair()\n>>> c, k = mceliece348864f.enc(pk)\n>>> mceliece348864f.dec(c, sk) == k\nTrue\n```\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A Python wrapper for the libmceliece microlibrary",
    "version": "0.0.1",
    "project_urls": {
        "Source": "https://www.github.com/ondesmartenot/pymceliece"
    },
    "split_keywords": [
        "post-quantum",
        "cryptography",
        "mceliece",
        "classic mceliece",
        "libmceliece",
        "pymceliece"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68a6f5aa6739b387398bc6b2b35d1a66129ecba8196f93a91dd0173b509f47ed",
                "md5": "3a78cd9351529015e568cb1459720902",
                "sha256": "4551eae31038f596f58937e3a804b29222edc827ff27958ba8b2b87c4e519213"
            },
            "downloads": -1,
            "filename": "pymceliece-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a78cd9351529015e568cb1459720902",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15388,
            "upload_time": "2023-10-10T08:14:31",
            "upload_time_iso_8601": "2023-10-10T08:14:31.179772Z",
            "url": "https://files.pythonhosted.org/packages/68/a6/f5aa6739b387398bc6b2b35d1a66129ecba8196f93a91dd0173b509f47ed/pymceliece-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69127cf9c038c55f004a49a45e45ad05dbe1592acea0715bb025fb4d3627ed6a",
                "md5": "20c5235790b6e97a555b2645ddf38abf",
                "sha256": "bfebc065a4330d2eb3e08be9b3ad3135a6c31d7a97764b53ff2d0065b93a2415"
            },
            "downloads": -1,
            "filename": "pymceliece-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "20c5235790b6e97a555b2645ddf38abf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 15085,
            "upload_time": "2023-10-10T08:14:32",
            "upload_time_iso_8601": "2023-10-10T08:14:32.919534Z",
            "url": "https://files.pythonhosted.org/packages/69/12/7cf9c038c55f004a49a45e45ad05dbe1592acea0715bb025fb4d3627ed6a/pymceliece-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-10 08:14:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ondesmartenot",
    "github_project": "pymceliece",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pymceliece"
}
        
Elapsed time: 0.17408s