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.3.tar.gz (28.7 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.3-cp39-abi3-win_amd64.whl (733.3 kB view details)

Uploaded CPython 3.9+Windows x86-64

pyrage-1.2.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (944.0 kB view details)

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

pyrage-1.2.3-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.3.tar.gz.

File metadata

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

File hashes

Hashes for pyrage-1.2.3.tar.gz
Algorithm Hash digest
SHA256 a8a1267edb962d13a1db1e0f8e03249568c6eab1d109a4d83b2d5a1c8613c98b
MD5 e675c8d20b5012b29a4a03a78a864ade
BLAKE2b-256 6bd65f40ede2378758bb9746cb40089008a447e08bfb4b19079b9dbae3ff44f7

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for pyrage-1.2.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2e174a903c9ba715c9cca401e75497154c9533c6a19e5fa3fa4ee21b47961a83
MD5 260e19cc437adfb52cc5d6c2b41b1e0e
BLAKE2b-256 22de365c16ada85816f191ecc4cedd8123fae920fecdb8f8b7783238fea50456

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrage-1.2.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5f9bb50b881b80cdd311eeff2c7b7b5aa5fa034f874651f471bce8ecc40681e
MD5 c03b772aa639b621b0c2b9927e6af4c6
BLAKE2b-256 ae5127a42a28aae6500fe7dcd549a6fa6690738e994726bd41e1b62a3cffa19b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.3-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.3-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.3-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 49891edc629b7c409d643feb0356daca241f936cad1373dd79895985522de42a
MD5 75c35247769bf7289f276e7890f7eb5c
BLAKE2b-256 3f35efbd61ce99ec38d4c384d3ca5fb8f5dcbf12ad466071e7edf64cce5b47d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.3-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