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.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-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (386.5 kB view details)

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

veriphi_core-0.1.3-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-cp39-abi3-macosx_11_0_arm64.whl (336.1 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

veriphi_core-0.1.3-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.tar.gz.

File metadata

  • Download URL: veriphi_core-0.1.3.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.tar.gz
Algorithm Hash digest
SHA256 043a26f4daba060a568e08cc61109ffdccc9272f9299494d886675ed79dbd53e
MD5 fd021ea204e961c6c750049fdd220712
BLAKE2b-256 e2220bb6252642d7672bbee616182d6f8f4bf0c9ed02f4341834fd197c85ae37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for veriphi_core-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e539d3e94be66f6acefd200f45c91785b8c02b616045e47ba9359f8f528f4ce
MD5 66a0c43ffdd61021db53b610a2beaf76
BLAKE2b-256 b5dceb1dfdb7a47d80dfe1b14ad01d82064b3dd1e93f8d27fd6d7234692f3442

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for veriphi_core-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 864f16cfb3547c4871751fc366c6764f568a70a5ec184dde10f5cc263e5bb5c6
MD5 732c3b1d05adde5a26481da61169d6de
BLAKE2b-256 5a382783f7930b3d36c50656b4ab08e31e38d9a42f38b471c6107db38d4098dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for veriphi_core-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3fa451d19147a9ebf7d253ffd08a5e00107bfb419ca90df23bfb1fbe943f2af5
MD5 486cca165b529bc3ffc42630622b6412
BLAKE2b-256 7524127f1f1ab0c735793603c4ba84edc086a24ca31e90f88ab4caeb1c47a3a1

See more details on using hashes here.

File details

Details for the file veriphi_core-0.1.3-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-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 53fae509ff55287629299e681da452d28392cae2bcb1fc4f347b87c94168bf22
MD5 4306cfa0a4b5edb542d5159d26465ac1
BLAKE2b-256 811abc70ac5970c12190a67337cb866520e4069a078744d88cb6120bb35a5637

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