Skip to main content

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_64 and aarch64, 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

  1. 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
    
  2. 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
    
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

veriphi_core-0.1.3.post1.tar.gz (41.7 kB view details)

Uploaded Source

Built Distributions

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

veriphi_core-0.1.3.post1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (386.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

veriphi_core-0.1.3.post1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (359.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

veriphi_core-0.1.3.post1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (665.5 kB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file veriphi_core-0.1.3.post1.tar.gz.

File metadata

  • Download URL: veriphi_core-0.1.3.post1.tar.gz
  • Upload date:
  • Size: 41.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for veriphi_core-0.1.3.post1.tar.gz
Algorithm Hash digest
SHA256 9171ffe5eed67cd7b41210cbd3040499e6af32ab338650406097f3b370b82e1d
MD5 1a889b21cbd30c82345f8c95f04dad44
BLAKE2b-256 8250fc81f4b7b8b0e8c3df3c3154afe09685505d59e453e733425292db891917

See more details on using hashes here.

File details

Details for the file veriphi_core-0.1.3.post1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for veriphi_core-0.1.3.post1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 45293ec0d4816addee1c280f30def0edcb873793e708f9e8998faacba10a4187
MD5 469af071092f3bcb586655727e19e270
BLAKE2b-256 70c6360663cced7dbd888750945d06e5d94715d2e0ec2d58f3b79909f2fc3fab

See more details on using hashes here.

File details

Details for the file veriphi_core-0.1.3.post1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for veriphi_core-0.1.3.post1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ba56f614f4158a369d344f068618c11dd6297757ac82a5295a2d97648a439052
MD5 d9bcc65b8d5423a7165bd56a503f52e1
BLAKE2b-256 1aeee9bb831f3367ef74080647b8f248d931e498eea46a4ae384b1b036d3524a

See more details on using hashes here.

File details

Details for the file veriphi_core-0.1.3.post1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for veriphi_core-0.1.3.post1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 f53f62f6c8773eff0067e5f76bd9aaa810740346e2c373b5745c1fcd4885cb86
MD5 0e99646c5d573f740434a231d818631d
BLAKE2b-256 ae68419653e69042e1835e60909b6afadb7bd03ba946528834d941f4d81f4006

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