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.0.2.tar.gz
(14.1 kB
view details)
Built Distributions
pyrage-1.0.2-cp37-abi3-win_amd64.whl
(544.2 kB
view details)
File details
Details for the file pyrage-1.0.2.tar.gz
.
File metadata
- Download URL: pyrage-1.0.2.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f231ef36000562021bc1061f3c154e6a07e989cb2441c7a863ed7f9eefc7f52b |
|
MD5 | cad394aa36ab401ab86a67ddca4c7bea |
|
BLAKE2b-256 | b9c9aee3639e473facd84901d5aef3676bcaaa43998ed0834ce5d199e3aa4205 |
File details
Details for the file pyrage-1.0.2-cp37-abi3-win_amd64.whl
.
File metadata
- Download URL: pyrage-1.0.2-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 544.2 kB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7925587d17d8ea3b237752f991a6a0f2cf4c8fb005d8c4241558403b4d0b3e59 |
|
MD5 | dda8e59cefb7cb739f00c123ee4a09d5 |
|
BLAKE2b-256 | 4089dcf9cc32c0bae159aa86cad847b5415553064712722367f3112444d9e227 |
File details
Details for the file pyrage-1.0.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: pyrage-1.0.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 665.0 kB
- Tags: CPython 3.7+, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 481735d633064d7c705ab60cc4d2fa09338bb100924a1328fc14b2fef247e714 |
|
MD5 | 9a10c1608f199f83f56397f110c9ce31 |
|
BLAKE2b-256 | c1ca3ae1bc664aee76666fda1f2cff03c6f19706f05ed30b03db2bf41dcf8f65 |
File details
Details for the file pyrage-1.0.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
.
File metadata
- Download URL: pyrage-1.0.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
- Upload date:
- Size: 1.2 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.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e2347c69376eb6655f7c64323064c43492e9f819aa82b4551e66ded86fd9169 |
|
MD5 | d61362f60961503d57e150fa5392af57 |
|
BLAKE2b-256 | d3c7542c6a3a6ecd26223adef9dbeb4b1daf033553838a0c4f4812d9b5358602 |