Skip to main content

Python bindings for rage (age in Rust)

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyrage-1.0.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (658.5 kB view details)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

pyrage-1.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (656.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

pyrage-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (656.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pyrage-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (656.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pyrage-1.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (656.0 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

File details

Details for the file pyrage-1.0.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 99468f91aecb9091f6b4fbfdac2e334ddb7153d585094deb330ab1ef8f314210
MD5 00611a4493c4c30c6762e6e58846ce26
BLAKE2b-256 5360f2e187a65420238fdbcc0bfe408615e618c7af47af0ab2be0b88902e46cf

See more details on using hashes here.

File details

Details for the file pyrage-1.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 672b468d0566543e4dd2ff9605660e4c08650e45af9b93f17c9df9500da4b363
MD5 0f95b02404e45009db21ce6ee47ef49b
BLAKE2b-256 06e8df0430ec304af1ea6852ff02075cac17d2125ec1302165202529c2146ce2

See more details on using hashes here.

File details

Details for the file pyrage-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5e30e7c015df0dd33d23bd34f7deadfb2ec14a8ccdea53c407367206a6d9fe3e
MD5 e60bbe3156b8fd544eebcb76f75fd756
BLAKE2b-256 344df71b8c3c89eff8340fb2b5b94b6ff77d14366ee8266b441c8e5893e9ce3a

See more details on using hashes here.

File details

Details for the file pyrage-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 689223a8661cb7d1cfc0ccb60d75e3e92e7189fdd2a299e35d71688cbec1e4af
MD5 8aebf1f86d37bfbd63e9b02b594d9b86
BLAKE2b-256 da8b5df288c204f9c8507aa7c1f227e46c8e8f9d85764389b26bff39321f82a2

See more details on using hashes here.

File details

Details for the file pyrage-1.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d611c9a5d69516081bd0f713fa790839fe7b868c21a60730c05cc896c15cb310
MD5 80aa171433ba8e7e15dc170defd0008d
BLAKE2b-256 a0c2bd845e15986db41da421204c3e559ef915b0e9aa78c96461a57413416c33

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page