OpenPGP (GnuPG) + AES-GCM crypto provider for Swarmauri
Project description
Swarmauri Crypto PGP
OpenPGP (GnuPG-backed) crypto provider implementing the ICrypto contract.
- Symmetric AEAD: AES-256-GCM
- Key wrapping: OpenPGP public-key encryption (RSA keys recommended)
- Hybrid encrypt-for-many supported
Key material expectations
encrypt/decrypt:KeyRef.materialmust be 16/24/32 bytes for AES-GCMwrap/encrypt_for_many:KeyRef.publicmust be ASCII-armored OpenPGP public key bytesunwrap:KeyRef.materialmust be ASCII-armored OpenPGP private key bytes
Installation
pip install swarmauri_crypto_pgp
Usage
from swarmauri_crypto_pgp import PGPCrypto
from swarmauri_core.crypto.types import KeyRef, KeyType, KeyUse, ExportPolicy
crypto = PGPCrypto()
# Symmetric key for AEAD
sym = KeyRef(
kid="sym1",
version=1,
type=KeyType.SYMMETRIC,
uses=(KeyUse.ENCRYPT, KeyUse.DECRYPT),
export_policy=ExportPolicy.SECRET_WHEN_ALLOWED,
material=b"\x00" * 32,
)
ct = await crypto.encrypt(sym, b"hello")
pt = await crypto.decrypt(sym, ct)
Entry point
The provider is registered under the swarmauri.cryptos entry-point as PGPCrypto.
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_crypto_pgp-0.2.0.dev3.tar.gz.
File metadata
- Download URL: swarmauri_crypto_pgp-0.2.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 |
53d328c94e5fd0470e56b214fc3869ddae5fc87babbb21012a0f537c4f188db9
|
|
| MD5 |
9cb2be1c26eeb3f60b98098a2f4802a8
|
|
| BLAKE2b-256 |
450f13fd118c6e0a9e16bf54f00333c5d2f2bae4a9bca57b7e56127b79f98493
|
File details
Details for the file swarmauri_crypto_pgp-0.2.0.dev3-py3-none-any.whl.
File metadata
- Download URL: swarmauri_crypto_pgp-0.2.0.dev3-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca07212b3c9c018f64e026c7d42e2d6fd3ed9ef5989493ed8eae235e34cf4fad
|
|
| MD5 |
635ebf11f90bd863df1ac78239b2494a
|
|
| BLAKE2b-256 |
a94b6d05e07a3078be22999405c9fb3279c860805b6524f5d27fa47335806174
|