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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
File details
Details for the file pyrage-1.0.1-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: pyrage-1.0.1-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 656.1 kB
- Tags: CPython 3.7+, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93bb26b093fc23276338f1a74e79b555f260af81899682c13edc1b10c9b92649 |
|
MD5 | 085c8be60ff1a8f01e7bb4ae6a97d9ae |
|
BLAKE2b-256 | acd27a9e6a2e8d17704ba7af4d014c98ad102a115bdb0b1924e44a1982501943 |
File details
Details for the file pyrage-1.0.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
.
File metadata
- Download URL: pyrage-1.0.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.7+, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a69e72b80525ceaa09b32d9b26838fcf46d69d781597c745a2deca4192cb103 |
|
MD5 | 97e0ebf72ea92e88a542e220f5fd996d |
|
BLAKE2b-256 | cf083b534ad088e34e60a39f14eca6a2c0c56ce6a8a5a2598f23277d33266943 |