Python bindings for veriphi-core routines
Project description
Veriphi Core Python Bindings
Overview
Veriphi Core exposes cryptographic guardrail primitives for orchestrating agent authorisation graphs. The Python bindings wrap the Rust implementation via PyO3 so you can generate keys, prepare conditional envelopes, and obfuscate packets from Python without managing the underlying Rust toolchain.
Installation
Once published, install directly from PyPI:
pip install veriphi-core
For local development inside the repository, install in editable mode with maturin:
pip install maturin
maturin develop --release
Quickstart
import numpy as np
from veriphi_core import interface
example_data = np.random.rand(1000) # Generate some test data
byte_data = example_data.tobytes() # Input data should be bytes
public_data, private_data = interface.setup_node(byte_data, 0, 1000, True) # Setup the encryption for conditions between 0, 1000
class_0, class_1 = interface.distribute_data(public_data, 'E', 2) # Distribute packets to 2 different classes
party_c0 = interface.encrypt_node(class_0,"class0_member")
party_c1 = interface.encrypt_node(class_1,"class1_member") # Each party independently processes the public data for their class
decrypted = interface.decrypt_node(private_data, 500, True, party_c0, party_c1) # recover the packet with the private data, a valid condition, and data from each class
recovered_example = np.frombuffer(decrypted, dtype=np.float64)
print(np.all(example_data == recovered_example))
Refer to notebooks/py_start.ipynb in the full repository for a complete walkthrough.
Supported Platforms
- macOS universal2 (
x86_64/arm64), Python 3.10+ - manylinux2014
x86_64andaarch64, Python 3.10+
The project also ships a source distribution so unsupported platforms can build from source if a compatible Rust toolchain is available.
Building Release Wheels Locally
- macOS universal build
rustup target add aarch64-apple-darwin x86_64-apple-darwin maturin build --release --strip --target universal2-apple-darwin -m rust/veriphi-core-py/Cargo.toml --out dist
- Linux manylinux (run from the repo root)
docker run --rm --platform=linux/arm64 -v "$ROOT":/io \ ghcr.io/pyo3/maturin:latest build --release --strip \ -m /io/rust/veriphi-core-py/Cargo.toml --out /io/dist --manylinux 2014 docker run --rm --platform=linux/amd64 -v "$ROOT":/io \ ghcr.io/pyo3/maturin:latest build --release --strip \ -m /io/rust/veriphi-core-py/Cargo.toml --out /io/dist --manylinux 2014
- Source distribution
maturin sdist -m rust/veriphi-core-py/Cargo.toml --out dist
After each build, install the resulting wheel in a clean environment and run pytest to validate the artefact.
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 Distributions
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 veriphi_core-0.1.1.tar.gz.
File metadata
- Download URL: veriphi_core-0.1.1.tar.gz
- Upload date:
- Size: 39.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a73d471d93f5c8b84a20af0c3977d521c974cd368fac370aa7dd52bede7bd0c4
|
|
| MD5 |
cdc01d882fa638792e68eb8d05bf6d0f
|
|
| BLAKE2b-256 |
aaaaab02702677386eb5478a469b08e1a2147444e43318b65167284b375c5f2d
|
File details
Details for the file veriphi_core-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: veriphi_core-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 377.1 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9009f3024de38b23094b7c991ffebf27df0632fb02b289cc9bb74ab270e0bd4
|
|
| MD5 |
0a7c2ba1b7c72c1ed1e2cbc15441fc06
|
|
| BLAKE2b-256 |
d8438389830c8d18f8a6bc9f8b7957e18878bb2f9e3e544324a99eb3ec982e40
|
File details
Details for the file veriphi_core-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: veriphi_core-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 348.6 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15cc0d016ced1e9880231382ac0d7afab05b81a36e1ab052af28e384f547cd11
|
|
| MD5 |
e05a81e0aa369bdac66fdab144e308bd
|
|
| BLAKE2b-256 |
7366d7b8ecb0214565f3bde554fd5ef20c44ec5e282bb99a952a865c352d4e74
|
File details
Details for the file veriphi_core-0.1.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: veriphi_core-0.1.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 646.8 kB
- Tags: CPython 3.9+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17f5d2e0722e385edf4ed11a1c32ca733b4fff4e6af82572794182071c234944
|
|
| MD5 |
66817305148cb994204285342be759a6
|
|
| BLAKE2b-256 |
c56eea0ba240daa8b2821ab1f1b74c741aa8c1808b5b999b72a831b7b1b60724
|