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.0.5.tar.gz (547.8 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.0.5-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for horcrux-1.0.5.tar.gz
Algorithm Hash digest
SHA256 5b2b52d50a3e63c04dd1681952da9a7f71bbaac887e3f9e77af466d3a0a4d757
MD5 65c8901db55c221abd941d9d6d191db1
BLAKE2b-256 55393b42a1fdbbc701204d1c0977f0ee18d30bff2e6e68341a6cb8a999141d3a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for horcrux-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7fec3495040cc6630a1d412a06f737e9234458be53eab1f3b7677eb217d43f03
MD5 18c59bbf143ba830a35adf7aedb2d4c4
BLAKE2b-256 1114547ed80ae3e8d7a581d213cf432cbf702b034314f3848e94660312a67c5a

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