Skip to main content

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.1.0.tar.gz (560.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

horcrux-1.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file horcrux-1.1.0.tar.gz.

File metadata

  • Download URL: horcrux-1.1.0.tar.gz
  • Upload date:
  • Size: 560.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for horcrux-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a67f5830e9ee3b230139414caf7102fbd6b6f4e778149d1b507be43c83767ac9
MD5 3a33ac874c8bea1e095c3e0936f85691
BLAKE2b-256 d7996b3560183dbe246c11e6b28065cccd4e502d5ab8eafdcdf71b3873c28fff

See more details on using hashes here.

File details

Details for the file horcrux-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: horcrux-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for horcrux-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fdd004673c7e503dfd28c0388495b845c0f1d847c79ad0328289b0f83ee7007
MD5 237e2e64b21176032a9b4c39bd34483c
BLAKE2b-256 ddec00fcaf7fe4b0d344e1ed76493f6dd87a9f204dec6022def631dfa6aa641e

See more details on using hashes here.

Supported by

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