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.2.5.tar.gz (29.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.5-cp39-abi3-win_amd64.whl (751.7 kB view details)

Uploaded CPython 3.9+Windows x86-64

pyrage-1.2.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (834.5 kB view details)

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

pyrage-1.2.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (767.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

pyrage-1.2.5-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.5 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.5.tar.gz.

File metadata

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

File hashes

Hashes for pyrage-1.2.5.tar.gz
Algorithm Hash digest
SHA256 b4da11d6fe5265b3e1d98c45afeadcdb89e2ac5072697e102262a2ab9f791918
MD5 fa8ef2bc4ba470ebf109f7b73118e20c
BLAKE2b-256 6362ccb05a7ea48cda6d7abc0610491b92dd8168028703c167babeaf34958ca1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyrage-1.2.5-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 751.7 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.2.5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 516e397b9596a444b82306b74ac85e12d73b36c0f8382f717e6f6c3f9d137abe
MD5 7a54d7b6488775e49f43737fdcf0c0d5
BLAKE2b-256 d756000fab8fe198b35ad7587e669fe43eca5334a6231b1e9637c0d32a7c2c9a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrage-1.2.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6863039a97e725c29802702493979250da934cd096c9fe584663432ec6855307
MD5 711318db4fc4b6f6807219f13c65e7e4
BLAKE2b-256 7108d9dbd67b15af7047b5ce03e4c6afaf8ef5994fc7fbcffdcfe7e11626da79

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrage-1.2.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7e36fa7a9f82b589341443677c74852d2f079b255621657852a461834c0f5ccb
MD5 5ccdcfd73cf7a93d58526c740fd94fce
BLAKE2b-256 fabde04f9e8eab116be48428f10cee74af39cb863cf7e1176d552734d39bfb81

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.5-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.2.5-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.5-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 bb5834f3e6c5bfdb440ecbb977c5122f1262c6bda7494b47e2ed0f412e5fc116
MD5 2ed9eeaefd310f2b61528721d8194e12
BLAKE2b-256 3377f774c89f4558f013ef05d1b13dc7ba625b758c85f0b3efe9486838711a82

See more details on using hashes here.

Provenance

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