Python wrapper for liboqs PyPi package
Project description
# Quantum-Proof Security with pyoqs_sdk in Python
[![Build status](https://www.python.org/static/community_logos/python-logo.png)](https://pypi.org/project/pyoqs-sdk/)
[![Build status](https://ci.appveyor.com/api/projects/status/jjo1ti9l5e0grgln?svg=true)](https://github.com/sagarbhure/pyoqs_sdk/releases/tag/v2.0) ![Python](https://img.shields.io/badge/python-v3.6+-blue.svg) ![Dependencies](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg) ![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg) ![License](https://img.shields.io/badge/license-MIT-blue.svg)
pyoqs_sdk PyPi : https://pypi.org/project/pyoqs-sdk/
The Open Quantum Safe (OQS) project has the goal of developing and prototyping quantum-resistant cryptography. liboqs is an open source C library for quantum-resistant cryptographic algorithms. See more about liboqs at https://github.com/open-quantum-safe/liboqs/, including a list of supported algorithms.
pyoqs_sdk is an open-source Python 3 library that wraps the liboqs C library. It offers a unified API for post-quantum key encapsulation and digital signature schemes, as well as a collection of open-source implementations of post-quantum cryptography algorithms.
The OQS project also includes prototype integrations into various application-level protocols to test the effectiveness of quantum-resistant cryptography. For more information, visit https://openquantumsafe.org/ ## Pre-requisite Python 3.x pyoqs_sdk depends on the liboqs C library; liboqs must first be compiled as a Linux/macOS/Windows library. ## Contents
This Project contains following Contents
pyoqs_sdk/pyoqs_sdk.py: a Python 3 module wrapper for the liboqs C library.
pyoqs_sdk/rand.py: a Python 3 module supporting RNGs from <oqs/rand.h>
test: unit test to be added
## Installation
This project is on [PyPI](https://pypi.org/project/pyoqs-sdk/) and can be installed with
` pip install pyoqs_sdk `
First, you must build liboqs according to the liboqs building instructions with shared library support enabled (add -DBUILD_SHARED_LIBS=ON to the cmake command), followed (optionally) by a sudo ninja install to ensure that the shared library is visible system-wide (by default it installs under /usr/local/include and /usr/local/lib on Linux/macOS).
On Linux/macOS you may need to set the LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on macOS) environment variable to point to the path to liboqs’ library directory, e.g. ` export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib `
Alternatively, you can install it from this repository directly:
` git clone https://github.com/sagarbhure/pyoqs_sdk cd pyoqs_sdk python3 setup.py install `
## Running Tests [In-progress]
To run the unit tests without a test runner: ` python3 tests/test_kem.py python3 tests/test_sig.py `
## Usage
The pyoqs_sdk library offers two main classes, KeyEncapsulation and Signature, for implementing post-quantum key encapsulation and signature mechanisms. To use these classes, you must instantiate them with a string that identifies one of the mechanisms supported by liboqs.
You can use the get_enabled_KEM_mechanisms() and get_enabled_sig_mechanisms() functions to enumerate the available options. The examples in the examples/ directory show how to use the library’s API. Additionally, the library supports alternative RNGs through the randombytes[] functions. ## Authors
[@sagarbhure](https://www.github.com/sagarbhure)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file pyoqs_sdk-1.0-py3-none-any.whl
.
File metadata
- Download URL: pyoqs_sdk-1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28659bb00be87bb0c9011dc03048faf9e1dda2ee715bd468f0b7a815334ebbd0 |
|
MD5 | 6fe85994db48db3769876a4896a3dd5f |
|
BLAKE2b-256 | 81ffbb20e0b1125611ad4bcfa2a7451f280f1460424397aec88cfc6da7315981 |