Age-style X25519 sealed-per-recipient MRE provider for Swarmauri
Project description
Swarmauri MRE Crypto Age
Age-based multi-recipient encryption provider implementing the IMreCrypto contract.
- Sealed-per-recipient X25519 stanzas
- ChaCha20-Poly1305 payload encryption
- Deterministic recipient identifiers via SHA-256 public key fingerprints
Installation
pip install swarmauri_mre_crypto_age
Usage
The provider exposes asynchronous helpers for encrypting data to many recipients and decrypting it for a specific private key. The example below walks through a complete round trip.
- Create the crypto provider.
- Generate key pairs for two recipients.
- Encrypt a payload for both recipients.
- Decrypt the payload for one recipient.
from swarmauri_mre_crypto_age import AgeMreCrypto
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
crypto = AgeMreCrypto()
# generate key pairs for each participant
sk1 = X25519PrivateKey.generate()
pk1 = sk1.public_key()
sk2 = X25519PrivateKey.generate()
pk2 = sk2.public_key()
recipients = [
{"kind": "cryptography_obj", "obj": pk1},
{"kind": "cryptography_obj", "obj": pk2},
]
env = await crypto.encrypt_for_many(recipients, b"secret")
pt = await crypto.open_for({"kind": "cryptography_obj", "obj": sk1}, env)
assert pt == b"secret"
Entry point
The provider is registered under the swarmauri.mre_cryptos entry-point as AgeMreCrypto.
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 swarmauri_mre_crypto_age-0.3.0.dev3.tar.gz.
File metadata
- Download URL: swarmauri_mre_crypto_age-0.3.0.dev3.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
404c2ee3bd35029827d0ca6017b7e8a9b52379d6a7e77438283df91d8f53286a
|
|
| MD5 |
b667b8bdf367b91eefc3cef8d76e2ae3
|
|
| BLAKE2b-256 |
48dcc424df41b198e8d0092d8d1f62221869c2c9597dea7eee1d5827bc6fdeaf
|
File details
Details for the file swarmauri_mre_crypto_age-0.3.0.dev3-py3-none-any.whl.
File metadata
- Download URL: swarmauri_mre_crypto_age-0.3.0.dev3-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05f5c234350117451adc497c655e1dda6df1d8b8971775e6fcb6041e13a50813
|
|
| MD5 |
fc9d2db907d66745f1a9390d445afd25
|
|
| BLAKE2b-256 |
e819f2e185bfbadac6d8d9855de8bd5e0af5ca996f30b6b15e2e406bde43567b
|