Skip to main content

Python bindings for rage (age in Rust)

Project description

pyrage

CI PyPI version

Python bindings for the Rust implementation of age.

Index

Installation

You can install pyrage with pip:

$ python -m pip install pyrage

PEP 561-style type stubs are also available:

$ python -m pip install pyrage-stubs

See the development instructions below for manual installations.

Usage

Identity generation (x25519 only)

from pyrage import x25519

ident = x25519.Identity.generate()

# returns the public key
ident.to_public()

# returns the private key
str(ident)

Identity-based encryption and decryption

from pyrage import encrypt, decrypt, ssh, x25519

# load some identities
alice = x25519.Identity.from_str("AGE-SECRET-KEY-...")
bob = ssh.Identity.from_buffer(b"---BEGIN OPENSSH PRIVATE KEY----...")

# load some recipients
carol = x25519.Recipient.from_str("age1z...")
dave = ssh.Recipient.from_str("ssh-ed25519 ...")

# encryption
encrypted = encrypt(b"bob can't be trusted", [carol, dave, alice.to_public()])

# decryption
decrypted = decrypt(encrypted, [alice, bob])

Passphrase encryption and decryption

from pyrage import passphrase

encrypted = passphrase.encrypt(b"something secret", "my extremely secure password")
decrypted = passphrase.decrypt(encrypted, "my extremely secure password")

Development

$ source env/bin/activate
$ make develop

Licensing

pyrage is released and distributed under the terms of the MIT License.

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

pyrage-1.2.2.tar.gz (28.8 kB view details)

Uploaded Source

Built Distributions

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

pyrage-1.2.2-cp39-abi3-win_amd64.whl (729.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

pyrage-1.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (942.7 kB view details)

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

pyrage-1.2.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.7 MB 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 pyrage-1.2.2.tar.gz.

File metadata

  • Download URL: pyrage-1.2.2.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyrage-1.2.2.tar.gz
Algorithm Hash digest
SHA256 82cb97b95516ab6d4c305e55ab8a2efe587ab7e4b8cc687aa9c3db7e10123ff5
MD5 31e9432c75be48bf203a85103e071e0e
BLAKE2b-256 b54050423a4270a0a3dc7c89702dfc5ac133e0a9cdf29550c207cd2c3151d61f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.2.tar.gz:

Publisher: release.yml on woodruffw/pyrage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrage-1.2.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: pyrage-1.2.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 729.8 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyrage-1.2.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4cd99d90ee4105c2c43a32d4d58f63073b2b5e8361d5ccb7a3855f9070e0257c
MD5 e2140045b3d1d3f41624d96a99ee7e16
BLAKE2b-256 30cb884a6a9f9a36402e98b31bf48ca939bdd3200e4b376227807f1d48279282

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.2-cp39-abi3-win_amd64.whl:

Publisher: release.yml on woodruffw/pyrage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrage-1.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba20e93cb8a8b24a30e4c83f7c607eb705142f4dbc42afc18a5657001e46466d
MD5 e84000a594b9574143a79f0f3c8059ed
BLAKE2b-256 f193ed79c036588f209451336cf361f6f347f43b1f7b432027fc4f845f8c784d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on woodruffw/pyrage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrage-1.2.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for pyrage-1.2.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 b7bdeedad0524fde93e9a7313a244eb00a994b156fd9c7a6c0277c30577a35ab
MD5 69ce6ccc7474ca1f7e7e6df3dbaf1445
BLAKE2b-256 a814cb9f6c0751ebddd98203fe1785932a78c04670272e4ad398b0fd9375bde9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on woodruffw/pyrage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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