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.2.1.tar.gz
(28.7 kB
view details)
Built Distributions
pyrage-1.2.1-cp38-abi3-win_amd64.whl
(710.5 kB
view details)
File details
Details for the file pyrage-1.2.1.tar.gz
.
File metadata
- Download URL: pyrage-1.2.1.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2225bcebb253ae2a59d36fdb4dbf5b292408efa7636fb67fbdc2cbfc66943d5f |
|
MD5 | 6bcd807706b27f79c2841e2ec35a22ec |
|
BLAKE2b-256 | 1886f145b5f8c36729fd7a47d7e399201dde0c301438e5bafb528f4984fa9207 |
File details
Details for the file pyrage-1.2.1-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: pyrage-1.2.1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 710.5 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37250feaeabe8fc97948cb3580f87ed31fea81f5e252fe19e50473cac71dc628 |
|
MD5 | 3507da6e3d9552ba95df6202eda9c632 |
|
BLAKE2b-256 | d470a1232576cc1aac83309a076ab10b1db63152909771c81709810000499a52 |
File details
Details for the file pyrage-1.2.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyrage-1.2.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 916.9 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af4f93a48979811595614fbd538727a8ac3d9c6cc976bfba3e928242fd06b0cf |
|
MD5 | 45901e6a3719efd5eb242e46682ac7d9 |
|
BLAKE2b-256 | 4292442a46a0c77a7a84275abba1bc7eb508006f763e0a870ea08e293bf0d35b |
File details
Details for the file pyrage-1.2.1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
.
File metadata
- Download URL: pyrage-1.2.1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 1.6 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/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c00fd07256bc21bf79b86f0c09cfacc7cb54087d62a4c92ae527d9b59f96e05 |
|
MD5 | 6cd097df6b52a63ece83dbadee66757a |
|
BLAKE2b-256 | 8546b21d9831a426a928bf15e4bd83471d34e8df6d3ab309d6ca4dc2fb341e2a |