Skip to main content

Python bindings for rage (age in Rust)

Project description

pyrage

CI PyPI version PyPI Downloads

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.3.0.tar.gz (30.1 kB view details)

Uploaded Source

Built Distributions

pyrage-1.3.0-cp39-abi3-win_amd64.whl (767.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

pyrage-1.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (847.7 kB view details)

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

pyrage-1.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (785.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

pyrage-1.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.6 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.3.0.tar.gz.

File metadata

  • Download URL: pyrage-1.3.0.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyrage-1.3.0.tar.gz
Algorithm Hash digest
SHA256 b283a2e3d688cbf68c707f57d93fdab3304ff57c7e2e6b710c0b4bc9096ad9da
MD5 e95bd306df5f6b157cb30d4c023b3049
BLAKE2b-256 eee8918161376594d69b294e920bd6444f1d9997e6e6dd2aca18e15f1ef72463

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.3.0.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.3.0-cp39-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for pyrage-1.3.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3be314a9746809c2710bfd144a6acf0c54a40f43e306857b9778a9d871ad97b3
MD5 f98f42019514bab953ab4d6fdb10008f
BLAKE2b-256 885915fd1945b02e6f93eff5a2ff352e67f85f51bf543769484f9bd960868c19

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.3.0-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.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ab066b22925c5a0ec5fead2e21e4586b21d5da730055c7e46caa978bd99de936
MD5 fe23dc4c1715c41f115054571354bc2d
BLAKE2b-256 38f3e91bf604fd40c42c60e8f95075cddb0b85d0bdf452f736b533b1bad550e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.3.0-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.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyrage-1.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ea452cb9c9c47083a96b309467dea5614d12530e1de4b6585f10aa04d3d19d1c
MD5 84c0247b59fc79422d44195e9d080b39
BLAKE2b-256 3be7f515fbc972a5d83e9fa82d1c23a16f733f4dd6c2c6ae33d9054ca04a8d92

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.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.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for pyrage-1.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 907901ada8d63d674cc9005889150846c7349ef587ee8bf5e9278b79c54b4679
MD5 c533d8b025339401cbbf8d9ca3a0618b
BLAKE2b-256 f76e3095678ee12f0401e1de17f4d6993783b20a4b807daf69e23b170724e5f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.3.0-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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page