Skip to main content

Pyodide-compatible ctypes interface for Open Quantum Safe liboqs

Project description

pyoqs-wasm

Pyodide-compatible ctypes interface for Open Quantum Safe (liboqs). This is a refactored liboqs-python wheel designed specifically for WebAssembly environments.

Installation

For Pyodide/PyScript

import micropip
await micropip.install("pyoqs-wasm")

For standard Python

pip install pyoqs-wasm

Usage

import oqs

# List available KEM algorithms
print(oqs.get_enabled_kem_mechanisms())

# Key Encapsulation
with oqs.KeyEncapsulation("ML-KEM-768") as kem:
    public_key = kem.generate_keypair()
    ciphertext, shared_secret_enc = kem.encap_secret(public_key)
    shared_secret_dec = kem.decap_secret(ciphertext)

# Digital Signatures  
with oqs.Signature("ML-DSA-65") as signer:
    public_key = signer.generate_keypair()
    signature = signer.sign(b"Message to sign")
    is_valid = signer.verify(b"Message to sign", signature, public_key)

Differences from liboqs-python

  • Bundles a WebAssembly-compiled liboqs.so for use in Pyodide
  • Includes explicit argtypes definitions for ctypes WASM compatibility
  • Loads liboqs from the package directory instead of attempting auto-install

Versioning

The version follows the pattern X.Y.Z.P where:

  • X.Y.Z is the upstream liboqs-python version
  • P is the pyoqs-wasm patch version

Credits

Based on liboqs-python by the Open Quantum Safe project.

License

MIT License (same as original liboqs-python). Third-party notices for the bundled liboqs binary are in THIRD_PARTY_LICENSES.md.

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

pyoqs_wasm-0.15.0.tar.gz (589.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyoqs_wasm-0.15.0-py3-none-any.whl (576.0 kB view details)

Uploaded Python 3

File details

Details for the file pyoqs_wasm-0.15.0.tar.gz.

File metadata

  • Download URL: pyoqs_wasm-0.15.0.tar.gz
  • Upload date:
  • Size: 589.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyoqs_wasm-0.15.0.tar.gz
Algorithm Hash digest
SHA256 3ba5d4705d34e30c661357ce0b2943ebc4bd5275c2289ecd7654019e0162d82f
MD5 fb790f893e9a9a4a69f7f602bec04ef1
BLAKE2b-256 4990b9ff31123c310d69a8eba19596c7dd68c21476525640db4ecf68389a9d71

See more details on using hashes here.

File details

Details for the file pyoqs_wasm-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: pyoqs_wasm-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 576.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyoqs_wasm-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0543f1cac5a36525c64c1f9ba610485f92274e4346a714e1a9047f68f849aab9
MD5 1823578aabbae5b17d3050b4c16c3a01
BLAKE2b-256 725e86ee2afdaf5ece2d4269d5560dc57d0dc49f4e05c33886d520332f376fe1

See more details on using hashes here.

Supported by

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