Public Verifiable Secret Splitting in Python
Project description
This project is a python (>= 3.7) implementation (library and CLI) of Publicly Verifiable Secret Splitting (PVSS).
PVSS is a non-interactive cryptographic protocol between multiple participants for splitting a random secret into multiple shares and distributing them amongst a group of users. An arbitrary subset of those users (e.g. any 3 out of 5) can later cooperate to reassemble the secret.
The common use case for secret splitting is to create a highly durable backup of highly sensitive data such as cryptographic keys.
All communication between the participants is public and everyone can verify that all messages have been correctly created according to the protocol. This verification is done through non-interactive zero-knowledge proofs.
The math is based upon the paper Non-Interactive and Information-Theoretic Secure Publicly Verifiable Secret Sharing by Chunming Tang et al. who extended Berry Schoenmaker’s paper A Simple Publicly Verifiable Secret Sharing Scheme and its Application to Electronic Voting which in turn is based on Shamir’s Secret Sharing.
One notable difference to prior work is the addition of a receiver user: In their scheme the secret is made public while it is being reassembled, which violates the goal to keep the secret secret. To address this issue, the users no longer disclose their share of the secret but use ElGamal encryption to securely convey the share to a separate receiver user who will then reassemble the secret. Like all other communication, the encrypted share is public and it can be verified that the users followed the protocol.
Documentation
Full documentation can be found at https://pvss.1e8.de/.
Installation
PVSS’s dependencies are:
python (>= 3.7)
- At least one of:
libsodium (>= 1.0.18, recommended, for Ristretto255 group)
On Debian (Bullseye / 11 and later) or Ubuntu (Eoan / 19.10 and later):
# apt install libsodium23
gmpy2 (Group of quadratic residues modulo a large safe prime)
You can install PVSS with pip:
$ pip install pvss
And optionally:
$ pip install gmpy2
Example
The following sequence of shell commands is executed by six different users who share a data directory. E.g. use git to synchronize it between the users. All files inside datadir are public. All files outside of it are private.
(init) $ pvss datadir genparams rst255
(alice) $ pvss datadir genuser Alice alice.key
(boris) $ pvss datadir genuser Boris boris.key
(chris) $ pvss datadir genuser Chris chris.key
(dealer) $ pvss datadir splitsecret 2 secret0.der
(receiver) $ pvss datadir genreceiver recv.key
(boris) $ pvss datadir reencrypt boris.key
(alice) $ pvss datadir reencrypt alice.key
(receiver) $ pvss datadir reconstruct recv.key secret1.der
secret0.der and secret1.der should compare equal. The dealer and receiver can encrypt an actual payload by using that file as a shared key.
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
Built Distribution
File details
Details for the file pvss-0.2.0.tar.gz
.
File metadata
- Download URL: pvss-0.2.0.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0 CPython/3.8.2rc1 Linux/5.4.0-3-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dc36aa5fec8173dc0eac6f1a84c6f4e59b5e7c0c83d574907757059a858e28c |
|
MD5 | ef933575df9e1a9a21fe2076163c9eab |
|
BLAKE2b-256 | 23dcc0eeea9399f8b8c8aaf7e005db42116b96a8df27b292319ef6cd4f9d4903 |
File details
Details for the file pvss-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pvss-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0 CPython/3.8.2rc1 Linux/5.4.0-3-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86b4d659df3aeaa3c64810d1352e47234dd3d2b42d9de3de16e38df2bb44efc6 |
|
MD5 | 36286d1edf137fd2affcd57be6a999dd |
|
BLAKE2b-256 | 56b862f6f7d8ec0d2f412008d09a8991f224eb3f6c429baae367f3895dbdfd14 |