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.2.tar.gz (39.3 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.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (377.1 kB view details)

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

veriphi_core-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (349.2 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

veriphi_core-0.1.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (646.3 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.2.tar.gz.

File metadata

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

File hashes

Hashes for veriphi_core-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9ae012dbd5430df389e9276d2186250ef363c96d8a525a0b7dc740ad0b657df2
MD5 60f48b2196c702cd420cc18cf3efb6ce
BLAKE2b-256 3977349b95d4b439325ae3aa56bef2626b72e3542ac3d979e67b99a0e94fdf04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for veriphi_core-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02e7595390fd16e7665258c70a2f917a1858104aa95273d203b4474bcf814613
MD5 e4b0da6e9ffdcb455f2b9ddfcf8de775
BLAKE2b-256 733c3b21903e50c787f5d662ea5ade67ca944745fe28202bd04d62af19a048bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for veriphi_core-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1268db8471d0b784935f7294103a206c654aa34ed0eba63e3cfa467ecccf9ee5
MD5 726b97b2f31e85799704a21a1c2650be
BLAKE2b-256 24b2e796709a020c4b7ff7e3d851541e3dfabf697464e37aef042f36c247bea1

See more details on using hashes here.

File details

Details for the file veriphi_core-0.1.2-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.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 f673a9c475e11083582962bce34edbf1092b7c518202830a9675b3f2eacad789
MD5 165ce7a5e93cb10207bd74dcc9f92d46
BLAKE2b-256 a7319d1bc1916cbf58a4ea1a6ee380037b8f349168cff7642b36f5cdd1d84a92

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