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.1_rc.6-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (658.9 kB view details)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

pyrage-1.0.1_rc.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (656.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

pyrage-1.0.1_rc.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (656.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pyrage-1.0.1_rc.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (657.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pyrage-1.0.1_rc.6-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (657.0 kB view details)

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

File details

Details for the file pyrage-1.0.1_rc.6-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.1_rc.6-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d6c07423c5dcfb1c6029acb0ec8a9890257b47e418d52f59580100ef1897ffdd
MD5 0d9eee3f91e5a0b91faefb39e3279444
BLAKE2b-256 3cf8dce2867362be6af92f391a44ed4304aaa13795bea70869f41f04b8e41592

See more details on using hashes here.

File details

Details for the file pyrage-1.0.1_rc.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.1_rc.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 06e0695c8af91a3912be5618be6f9f486bf325ec6dd2bc95bac07eb80fe6a4bc
MD5 265f8dedc782ce9b0bbc54ba7e9ad8c6
BLAKE2b-256 d19b50da4b9cd927a76e03b2fc6231b352dd80c1102df79703661327544af48a

See more details on using hashes here.

File details

Details for the file pyrage-1.0.1_rc.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.1_rc.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 071a73a89f3ef18f3386764a6e17a4ca751c7b4c20f9959697c3d0ae45708fc8
MD5 7eb7cbe6984774814eb5605aa098fd1d
BLAKE2b-256 d9d3336d28db58c98cfa563a42c8b4daa67255ab4d9ffee8cc2f1cb7cc4fd22b

See more details on using hashes here.

File details

Details for the file pyrage-1.0.1_rc.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.1_rc.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fc0969cc3110526db3e54dcf9689c078c5bb161d1ea50b51a5c8e9f466e1391c
MD5 cfa41c0da6e4d3eb533617d604748d94
BLAKE2b-256 63b18104fc2f3d9c23d04a9d3c5ebb8a87b62c9cc796d9bfd4d36a5b661ae871

See more details on using hashes here.

File details

Details for the file pyrage-1.0.1_rc.6-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.1_rc.6-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 24f39867b77be4c9334d22a6b57bd7825d26d06539f43c00ea9d9a2e1c7222d2
MD5 4f7fd8e64df8e3b7c087ef76d4f42ead
BLAKE2b-256 5d64159fcc303f7e399eaa50c6cd89e262923e15f319c6143446372c85b6615a

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