Python library that provides a simple interface for symmetric (i.e., secret-key) and asymmetric (i.e., public-key) encryption/decryption primitives.
Project description
RbCl
Ristretto group Python binding to libsodium
RbCl supports Python 2.7 and 3.5+ as well as PyPy 2.6+.
import rbcl.bindings as lib
x = lib.crypto_core_ristretto255_random()
assert lib.crypto_core_ristretto255_is_valid_point(x)
y = lib.crypto_core_ristretto255_from_hash(b'\xF0'*64)
assert lib.crypto_core_ristretto255_is_valid_point(y)
z1 = lib.crypto_core_ristretto255_add(x, y)
z2 = lib.crypto_core_ristretto255_add(y, x)
assert z1 == z2 # Assert that point addition commutes (in L)
w1 = lib.crypto_scalarmult_ristretto255(s1, lib.crypto_scalarmult_ristretto255(s2, x))
w2 = lib.crypto_scalarmult_ristretto255(s2, lib.crypto_scalarmult_ristretto255(s1, x))
assert w1 == w2 # Assert that point multiplication (by a scalar) is repeated addition (in L)
The following bindings are made available:
Constructors
crypto_core_ristretto255_random()
crypto_core_ristretto255_from_hash(h)
crypto_core_ristretto255_is_valid_point(p)
Scalar arithmetic
crypto_core_ristretto255_scalar_add(s1, s2)
crypto_core_ristretto255_scalar_sub(s1, s2)
crypto_core_ristretto255_scalar_mul(s1, s2) # NOT scalar mulitplication of a point!
crypto_core_ristretto255_scalar_complement(s)
crypto_core_ristretto255_scalar_invert(s)
crypto_core_ristretto255_scalar_negate(s)
crypto_core_ristretto255_scalar_reduce(s)
crypto_core_ristretto255_scalar_random()
Point arithmetic
crypto_core_ristretto255_add(p, q)
crypto_core_ristretto255_sub(p, q)
crypto_scalarmult_ristretto255(p, s)
crypto_scalarmult_ristretto255_base(s)
Constants
crypto_scalarmult_ristretto255_bytes crypto_scalarmult_ristretto255_scalarbytes crypto_core_ristretto255_bytes crypto_core_ristretto255_scalarbytes crypto_core_ristretto255_hashbytes crypto_core_ristretto255_nonreducedscalarbytes
Helpers
randombytes randombytes_buf_deterministic sodium_bin2hex sodium_hex2bin sodium_base642bin sodium_base64_encoded_len sodium_bin2base64 sodium_pad sodium_unpad
Manual installation
# Build as a wheel and install
python setup.py bdist_wheel
python -m pip install --force-reinstall dist/rbcl-*.whl
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
rbcl-0.1.0.tar.gz
(2.0 MB
view hashes)
Built Distributions
rbcl-0.1.0-cp35-abi3-win_amd64.whl
(112.7 kB
view hashes)
rbcl-0.1.0-cp35-abi3-win32.whl
(105.0 kB
view hashes)
Close
Hashes for rbcl-0.1.0-cp39-cp39-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca0d5dca863ea1e5493bfe978b49b27fc1f0d00759a536fe5bdeb49780e83113 |
|
MD5 | f7eca0a71dc71f9b45aca54318d42032 |
|
BLAKE2b-256 | e62f065cc7bccf671897f9474bde9b48b6a44862f6171c627bb7d93f3d88df5b |
Close
Hashes for rbcl-0.1.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e3bd3ad5d2a2187de5888dec6ada371085400597c549319e1b6f3cc9eaf7ebf |
|
MD5 | 9bccc1dd068d15d4513e4c068aa1c29f |
|
BLAKE2b-256 | 5947fe1859baed4b41bda5a8945b798b62e99840fb4a786124d9fa4f2ecf33c5 |
Close
Hashes for rbcl-0.1.0-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed81366fc28213f776368255411aa5be1f1f75cc6d7a0c10ea97cfec02c1814 |
|
MD5 | cadca63fc704e7eb67ca80b4d321b25a |
|
BLAKE2b-256 | d4ef55633b07129ca043bfa11c18d8f0373f92ff07ca6dd1a1aec17a4265aad3 |
Close
Hashes for rbcl-0.1.0-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8b92ba31b15986e500bb9ecf339795c4ea3dbcb6e24c33f8c448b6a9a4e52bf |
|
MD5 | 73fa8ed90d625bfef413287d01e0190d |
|
BLAKE2b-256 | 18c5f307005023fc4b4dd01a5c0f4070412e7dfbbe0d05d571661414920b5c9d |
Close
Hashes for rbcl-0.1.0-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 549b284985aa26ac8f670add2476a9d5e5d3bd380b24472a828a8d44dfccb229 |
|
MD5 | cae65ad5d9fccf3e847743176b24b7cc |
|
BLAKE2b-256 | 1e527ca7c77d9be575235498d2f7c9251709039511e97ec34399149a1cc94b06 |
Close
Hashes for rbcl-0.1.0-cp35-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40d29f4323791b61e878c5f0821191dbfe1e5f70d8edd2f2e18f59cf19cf1c56 |
|
MD5 | b7e2a4d5cc0fc89525224e6f5213229e |
|
BLAKE2b-256 | 8629e122f6c703abfd2b4324ea84d4b5de9675870f9e423e261e10084395be06 |
Close
Hashes for rbcl-0.1.0-cp35-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e98c168d79e1de97d506e9831b4c291630d66936849ab0032105f4b58653f7da |
|
MD5 | 8bae66f265652c3354e8a397c6351a94 |
|
BLAKE2b-256 | 2f06f5768ed5ecb6b133434b905e517432a76e365448f09f54584d64f5786e28 |
Close
Hashes for rbcl-0.1.0-cp35-abi3-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bd5f36dd4d2d915278cba26ee009df3a06119221f7526763fb5f80db2a6b8b5 |
|
MD5 | c75f0ed00f325288962dadd048c64917 |
|
BLAKE2b-256 | e9bb44243de87455ae7911bca195a42a906087209902e69340fb7edf6b06792b |
Close
Hashes for rbcl-0.1.0-cp27-cp27mu-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28508b803d4db11822200abd681b69d8a0eac097cd076a224cab08637565814e |
|
MD5 | 97c7ff2ef329393f3d427a7d988f233e |
|
BLAKE2b-256 | 7ede40e8b24eae9ddee9ac524247d886169aaa41be0c528e671a3fdc909da02a |
Close
Hashes for rbcl-0.1.0-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1242a5a3f3b209af5dad504e0e9a7cf00922f7b27006159f699dba9d0b384fd8 |
|
MD5 | 6980b9d2055ef5a38538fd0b62d487e7 |
|
BLAKE2b-256 | 89b38b4d373096e7beb2820fa0aa46f4fac74f5df14c5b213d8e5e2fb99587c8 |
Close
Hashes for rbcl-0.1.0-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c069284e12b8fbefd5e08a1c2c8c55e3ae8d39d58f078368287395dce8fffc68 |
|
MD5 | d528cd36ba09abcd6a12c9ff0a0ea89a |
|
BLAKE2b-256 | db899dc2695e0c71258b4c44d47e4db0540f7c6d4227fe1f66186767b33475fd |