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.3rc2-cp37-abi3-win_amd64.whl (549.0 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pyrage-1.0.3rc2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (646.5 kB view details)

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

pyrage-1.0.3rc2-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

File details

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

File metadata

  • Download URL: pyrage-1.0.3rc2-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 549.0 kB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for pyrage-1.0.3rc2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b24065062aa64b311163e80217ed2e3549c2e3b9e405783696b86302750136af
MD5 8f2ca9ec11b703ecc36a2c8c5ad7b67b
BLAKE2b-256 b789b4d1ce204d4b89bb0be9dd92e6c2cfa42aadad43257f26863273bb2b50e4

See more details on using hashes here.

File details

Details for the file pyrage-1.0.3rc2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrage-1.0.3rc2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6b89691a3972b4fb57d6f683429143bd13a3a5a72a5e842a2f50ebb64276640a
MD5 f9cdd00136105c2603f6e539b5cb3565
BLAKE2b-256 39d57736ed33232b5d852c424094e456ff95f97bfaedf9b0066b99afa93ca224

See more details on using hashes here.

File details

Details for the file pyrage-1.0.3rc2-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.3rc2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f2c1783768fff9fb485b8ab576cb05dbd2ebb335e4c450d49855efcc8328c499
MD5 8b4d9d1f9eb25c7a7b06a402fa307b63
BLAKE2b-256 e22602866ff8492e6fa11758cd0d72b5f0e1155600b62d00b5ee49575c16197e

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