Python bindings for rage (age in Rust)
Project description
pyrage
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
Release history Release notifications | RSS feed
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.1.3rc1.tar.gz
(25.8 kB
view hashes)
Built Distributions
Close
Hashes for pyrage-1.1.3rc1-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7545f9b29f36c836994679ebe8d74b2cf983ec79a965cd5a1e133a2af57c255c |
|
MD5 | df1a41f0533ab83435dc4b5b61de8cc4 |
|
BLAKE2b-256 | d4b40cfa29ad3cea7647d54bf70a6a9cf7c153b642efdb10bffbeed94e887ef3 |
Close
Hashes for pyrage-1.1.3rc1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 038c416ce2f77ffbdd02bd22f22a2b9c51ec01ca0ab0af9a46b2104b36451290 |
|
MD5 | 40b9d0171c94a61199eab2984ea903a8 |
|
BLAKE2b-256 | bf7209aa82e1767aaa02c905a8802411a46a1703a966fa7a4550f1cec84488e5 |
Close
Hashes for pyrage-1.1.3rc1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28e0852261104f1a055968c3f378e6b105f3c6706471fb5bff5f1c9424b581b0 |
|
MD5 | 86c868ee0e9d50a906fe747c30d91c91 |
|
BLAKE2b-256 | 938a50c69ed9820335b28aef30f734ab185b1e4725a8d605c85e2abd62df7dd5 |