Skip to main content

Horcrux - A Python implementation of Shamir's Secret Sharing.

Project description

codecov PyPI version License Sanity tests

Horcrux

A Python implementation of Shamir's Secret Sharing, based of Hashicorp's implementation for Vault.

Shamir's Secret Sharing

Shamir's Secret Sharing in an efficient algorithm for distributing private information. A secret is transformed into shares from which the secret can be reassembled once a threshold number are combined.

Example

from shamir import combine, split


def hello() -> None:
    """Split a byte-string and recombine its parts."""
    secret: bytes = b"Hello, World!"
    shares: int = 5
    threshold: int = 3

    parts: list[bytearray] = split(secret, shares, threshold)
    combined: bytearray = combine(parts[:3])
    print(combined.decode("utf-8"))


if __name__ == "__main__":
    hello()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

horcrux-1.0.3.tar.gz (10.4 kB view hashes)

Uploaded Source

Built Distribution

horcrux-1.0.3-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page