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.2.tar.gz
(25.7 kB
view details)
Built Distributions
pyrage-1.1.2-cp38-abi3-win_amd64.whl
(567.3 kB
view details)
File details
Details for the file pyrage-1.1.2.tar.gz
.
File metadata
- Download URL: pyrage-1.1.2.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a66dc84c624f7fdd43462c221c58a3c5b75744ceb0600fd75f41bf590af8e5b |
|
MD5 | 47ef12652a097af19041b8205007b587 |
|
BLAKE2b-256 | ee097dcd2a490d20aa5dd0f55aa667ccf697c84117bd1f06f2b889e680a1ee5d |
File details
Details for the file pyrage-1.1.2-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: pyrage-1.1.2-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 567.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 | e3566f88a062a54d721c800dff511956d51f7ea28324ffbe0648e5adcdb6bc42 |
|
MD5 | 00a3016866ff63e2708f54b141f1d177 |
|
BLAKE2b-256 | 48a866172db5564b3af756bb200fbf1246525a39060b265fa35933c381696a42 |
File details
Details for the file pyrage-1.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyrage-1.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 689.1 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 | b16eed33e5d630d821d4ccdb78f452deb5ebce2730515d2ca24971216772a1a9 |
|
MD5 | c2c37f560d1fd0eac896512c3dfc1492 |
|
BLAKE2b-256 | cc98f59fc4b1e3ae08d72746c46a57bb9d117e02d538983bab8a0bce057dffc7 |
File details
Details for the file pyrage-1.1.2-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
.
File metadata
- Download URL: pyrage-1.1.2-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 | 19fdd4218b53b95de40d4cdb5111718679f8f14d1dd9ab3fdc894009b7c3911d |
|
MD5 | 33495d076a84fcce73ebabb2ef813a8e |
|
BLAKE2b-256 | 77121395d27dba6e595bb7d56c5a8a9fd62ffbcaec8155b656d790edcdeaf84a |