Skip to main content

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.

Release files for pvss 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pvss 0.2.0
File Size Uploaded
pvss-0.2.0.tar.gz 19.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pvss 0.2.0
File Interpreter ABI Platform
pvss-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size:40.9 kB

Release files / pvss-0.2.0.tar.gz

Download URL pvss-0.2.0.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9dc36aa5fec8173dc0eac6f1a84c6f4e59b5e7c0c83d574907757059a858e28c
BLAKE2b-256 checksum
How to use checksums
23dcc0eeea9399f8b8c8aaf7e005db42116b96a8df27b292319ef6cd4f9d4903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.0 CPython/3.8.2rc1 Linux/5.4.0-3-amd64

Release files / pvss-0.2.0-py3-none-any.whl

Download URL pvss-0.2.0-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86b4d659df3aeaa3c64810d1352e47234dd3d2b42d9de3de16e38df2bb44efc6
BLAKE2b-256 checksum
How to use checksums
56b862f6f7d8ec0d2f412008d09a8991f224eb3f6c429baae367f3895dbdfd14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.0 CPython/3.8.2rc1 Linux/5.4.0-3-amd64

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page