Skip to main content

# 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

Metadata

Release files for pyoqs-sdk 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pyoqs-sdk 1.0
File Interpreter ABI Platform Actions
pyoqs_sdk-1.0-py3-none-any.whl Python 3 none any Details for pyoqs_sdk-1.0-py3-none-any.whl

Release files / pyoqs_sdk-1.0-py3-none-any.whl

Download URL pyoqs_sdk-1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28659bb00be87bb0c9011dc03048faf9e1dda2ee715bd468f0b7a815334ebbd0
BLAKE2b-256 checksum
How to use checksums
81ffbb20e0b1125611ad4bcfa2a7451f280f1460424397aec88cfc6da7315981
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Security for pyoqs-sdk 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page