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-0.1.1_rc.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (658.4 kB view details)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

pyrage-0.1.1_rc.2-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-0.1.1_rc.2-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-0.1.1_rc.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (655.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pyrage-0.1.1_rc.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (655.8 kB view details)

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

File details

Details for the file pyrage-0.1.1_rc.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-0.1.1_rc.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4eb1c44249a0c899c7786070631feca315bd83d54955c9775f31ef871c89d502
MD5 a088dfd9ac6c04fc256ce18349467283
BLAKE2b-256 c89d892b0470407baa63056d27c7b82a22d05d589475b1147386d0e37e583de4

See more details on using hashes here.

File details

Details for the file pyrage-0.1.1_rc.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-0.1.1_rc.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5e8eeaccff78ce2ff1124c2a44a4c458a37bca760cc6adc7f10a9896175d8520
MD5 5546a598ec861f10089347fe2f61e37c
BLAKE2b-256 55cdb9847063d8470138ed19bb423409110e2d4f26be92e910ca1e026a082b74

See more details on using hashes here.

File details

Details for the file pyrage-0.1.1_rc.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-0.1.1_rc.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 45ed25e9f6d110f9dfdaa309b20e20f3b16e4d10528eea52be10be265dadd40e
MD5 5981d7e8f1d6f1492d1f2a1880c6d456
BLAKE2b-256 57341298ae5d35dbf3558015340f8373665ff8b8389a1a8c296de5a2052a855d

See more details on using hashes here.

File details

Details for the file pyrage-0.1.1_rc.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-0.1.1_rc.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ea187fce77d61d015feda2f155b59636565eb71b4991857f45cbf88173013d86
MD5 1c1377a9fc76c5218aef6d13be703283
BLAKE2b-256 ca2c86b3184a9984383fe9154e74c4d29b173bfb32763b0bf71846703ea25a7c

See more details on using hashes here.

File details

Details for the file pyrage-0.1.1_rc.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-0.1.1_rc.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6884fa5a12bb49b44f4662a098629363d094efa7dcfe3cdb704557db0ebb2ae1
MD5 81c50d116fc4374fe9034f6dad4fd5a0
BLAKE2b-256 e5827da77c0d0c74103add1e572cd4c7f48e31967b12ee1b5d1bce6724c0f9e4

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