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

Uploaded Source

Built Distributions

pyrage-1.2.4-cp39-abi3-win_amd64.whl (752.5 kB view details)

Uploaded CPython 3.9+ Windows x86-64

pyrage-1.2.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (969.3 kB view details)

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

pyrage-1.2.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (935.0 kB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ ARM64

pyrage-1.2.4-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.8 MB view details)

Uploaded CPython 3.9+ macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

File details

Details for the file pyrage-1.2.4.tar.gz.

File metadata

  • Download URL: pyrage-1.2.4.tar.gz
  • Upload date:
  • Size: 29.7 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.4.tar.gz
Algorithm Hash digest
SHA256 d14cf05da3f66ed57e625a5269e1e8804a53be83c6689d77f2bfc49e9794b6ef
MD5 70f90c8136ebcf844d5a67ea725f95a8
BLAKE2b-256 9d7757c33a54a20e745c0d3642c1cb2f22f2cbc580d35e3b9d878c36b54b6812

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyrage-1.2.4-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 752.5 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.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8dac1f31b88d9f5de6af3b94b613f775b96d04bf962dbc1954c9bdb263c556fc
MD5 2de71b7fd2695fbef5b36d687579dc7a
BLAKE2b-256 055051226700cd055d4ea7772c214739ad715398dd75f874bb7fc11ea8b18091

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrage-1.2.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cdbae5da22c92d5e3c0b50a20fa18e0e55e69da15bff5a8c5ea333a262ab79ea
MD5 3a1762e5f889cb28883ca838b49b21a0
BLAKE2b-256 bf24e8228150298a3a348d1b27e5586f2f191321a8659f40dfe61606431c977b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrage-1.2.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 52a2ad032041fd695c24e94f8629594c232abd506b8825c2f42f6c0e66c09ae6
MD5 eed8890e308909d04b94f78a35bb8dea
BLAKE2b-256 e14d630200e91d0aeeaf1361b976ee0e3a436e88e7d0e456063ecb573d7cbdb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.4-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.4-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.4-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 7faf916520e188224eca97b0acf9391a7fe306bb9ee53d6106f8300b149811a7
MD5 ad322abf2d338cf81fc806586c877e3a
BLAKE2b-256 77ef398254e3e46f223b525c85769eb697ee09ac6f191dc35f5460c2b9b154b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrage-1.2.4-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 AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page