Skip to main content

pyrage

CI

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.

Release files for pyrage 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pyrage 1.0.0
File
pyrage-1.0.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 Linux glibc 2.5+ x86-64 Details
pyrage-1.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.5+ x86-64 Details
pyrage-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
pyrage-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
pyrage-1.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details

Total release size: 3.3 MB

Release files / pyrage-1.0.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL pyrage-1.0.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 658.5 kB
Tags Linux glibc 2.5+ x86-64 PyPy 3.7 PyPy 3.7 7.3
SHA-256 checksum
How to use checksums
99468f91aecb9091f6b4fbfdac2e334ddb7153d585094deb330ab1ef8f314210
BLAKE2b-256 checksum
How to use checksums
5360f2e187a65420238fdbcc0bfe408615e618c7af47af0ab2be0b88902e46cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release files / pyrage-1.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL pyrage-1.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 656.4 kB
Tags CPython 3.10 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
672b468d0566543e4dd2ff9605660e4c08650e45af9b93f17c9df9500da4b363
BLAKE2b-256 checksum
How to use checksums
06e8df0430ec304af1ea6852ff02075cac17d2125ec1302165202529c2146ce2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release files / pyrage-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL pyrage-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 656.6 kB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
5e30e7c015df0dd33d23bd34f7deadfb2ec14a8ccdea53c407367206a6d9fe3e
BLAKE2b-256 checksum
How to use checksums
344df71b8c3c89eff8340fb2b5b94b6ff77d14366ee8266b441c8e5893e9ce3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release files / pyrage-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL pyrage-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 656.0 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
689223a8661cb7d1cfc0ccb60d75e3e92e7189fdd2a299e35d71688cbec1e4af
BLAKE2b-256 checksum
How to use checksums
da8b5df288c204f9c8507aa7c1f227e46c8e8f9d85764389b26bff39321f82a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release files / pyrage-1.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL pyrage-1.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 656.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
d611c9a5d69516081bd0f713fa790839fe7b868c21a60730c05cc896c15cb310
BLAKE2b-256 checksum
How to use checksums
a0c2bd845e15986db41da421204c3e559ef915b0e9aa78c96461a57413416c33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page