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.sofor use in Pyodide - Includes explicit
argtypesdefinitions 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.Zis the upstream liboqs-python versionPis the pyoqs-wasm patch version
Credits
Based on liboqs-python by the Open Quantum Safe project.
License
MIT License (same as original liboqs-python)
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyoqs_wasm-0.15.1.0.tar.gz.
File metadata
- Download URL: pyoqs_wasm-0.15.1.0.tar.gz
- Upload date:
- Size: 587.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
012f180b585001cfda785eb1a6b23507bfef6cf9d14dd98cf4940a95098a0688
|
|
| MD5 |
7e5a52317adc705dd3768a7f0a10cd83
|
|
| BLAKE2b-256 |
199a920a59035bcb602b5cb1bba5ae89cb90b4e931d7c27ccb316baa78148d5b
|
File details
Details for the file pyoqs_wasm-0.15.1.0-py3-none-any.whl.
File metadata
- Download URL: pyoqs_wasm-0.15.1.0-py3-none-any.whl
- Upload date:
- Size: 579.1 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57e6a3934a37c20e1f5f7d7c81354cd30a54c8f987b9853d810200aa1f3b9075
|
|
| MD5 |
d16e3ce2afe32f1ddf7bae5e038ff4c8
|
|
| BLAKE2b-256 |
df95f7819003a3a427cd606842cb7bec2ee87651b433c3259a99ad408f49d5e5
|