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 details)
Built Distributions
File details
Details for the file pyrage-1.1.3rc1.tar.gz
.
File metadata
- Download URL: pyrage-1.1.3rc1.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 813310d9fddf5a522fe5174a40c1cd63224c0cafa3f29c999f3642f9fec9b441 |
|
MD5 | 68d3f318bfe9240e771d32c299c21503 |
|
BLAKE2b-256 | 9f4fb68fcbd3f5b28ddaae4960d917cbe89e7d3426f3fb30ae5b5830d88f0c35 |
File details
Details for the file pyrage-1.1.3rc1-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: pyrage-1.1.3rc1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 560.3 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7545f9b29f36c836994679ebe8d74b2cf983ec79a965cd5a1e133a2af57c255c |
|
MD5 | df1a41f0533ab83435dc4b5b61de8cc4 |
|
BLAKE2b-256 | d4b40cfa29ad3cea7647d54bf70a6a9cf7c153b642efdb10bffbeed94e887ef3 |
File details
Details for the file pyrage-1.1.3rc1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyrage-1.1.3rc1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 689.5 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 038c416ce2f77ffbdd02bd22f22a2b9c51ec01ca0ab0af9a46b2104b36451290 |
|
MD5 | 40b9d0171c94a61199eab2984ea903a8 |
|
BLAKE2b-256 | bf7209aa82e1767aaa02c905a8802411a46a1703a966fa7a4550f1cec84488e5 |
File details
Details for the file pyrage-1.1.3rc1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
.
File metadata
- Download URL: pyrage-1.1.3rc1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28e0852261104f1a055968c3f378e6b105f3c6706471fb5bff5f1c9424b581b0 |
|
MD5 | 86c868ee0e9d50a906fe747c30d91c91 |
|
BLAKE2b-256 | 938a50c69ed9820335b28aef30f734ab185b1e4725a8d605c85e2abd62df7dd5 |