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 Distribution

pyrage-1.0.2_rc.2.tar.gz (14.0 kB view details)

Uploaded Source

Built Distributions

pyrage-1.0.2rc2-cp37-abi3-win_amd64.whl (544.3 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pyrage-1.0.2rc2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.2 MB view details)

Uploaded CPython 3.7+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

pyrage-1.0.2_rc.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl (665.1 kB view details)

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

File details

Details for the file pyrage-1.0.2_rc.2.tar.gz.

File metadata

  • Download URL: pyrage-1.0.2_rc.2.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyrage-1.0.2_rc.2.tar.gz
Algorithm Hash digest
SHA256 fb712883e1d69c8d71a770b78d48070f781924866b5e6fbafa9a6c27e78e9cd7
MD5 c10022533237de41236ca1dff9266a82
BLAKE2b-256 135ef69b15612a49e522f5c7e1ce1ec66f1923f42f806cd4f39f6daa719cd7f3

See more details on using hashes here.

File details

Details for the file pyrage-1.0.2rc2-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: pyrage-1.0.2rc2-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 544.3 kB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyrage-1.0.2rc2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f1e44fdf2e46fe4ffa52f6b44b46e003e8c8db9148025ca9515e92b71d220535
MD5 4eab485070a3e8cdb318c41ff8f1ed5e
BLAKE2b-256 9ff69683a5a2f642fb22f6d052f112eee248226874400e9b67017b60b666360d

See more details on using hashes here.

File details

Details for the file pyrage-1.0.2rc2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyrage-1.0.2rc2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 09c8846d667f990bf54d05b4953ecc9992d8cfc2fb50e714c0c76f090a1575f9
MD5 7e515b8007e012743d988e3603ec8f6f
BLAKE2b-256 cc5184c548e20e32233f5d02d8597d3a9af42882c7609325d843664f8cc31541

See more details on using hashes here.

File details

Details for the file pyrage-1.0.2_rc.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.2_rc.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8f85a6116c0c404eead3c77c547a3cdfd3e2ee4707a5d3a7231093fc6c36d546
MD5 85ac3f02816d9de9d4b897bd18ff5343
BLAKE2b-256 3afd2ba1bd27c3d611d5ac1524fd1ffe6a0602fdfbeada38f2820dd7b1635455

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