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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for horcrux-1.0.7.tar.gz
Algorithm Hash digest
SHA256 c9e3e23495b1a9d2900302849077f3f66676520327bd520686c6f39175d08a85
MD5 0f751ded97590e4eb67dce3ceb50da95
BLAKE2b-256 155bf7084385c0f4bb1a629ccaddd204c0ee08c41c826e07e6b364638c2694b0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for horcrux-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a572f55a5bcd01bfd3e82df218a6312177ea4034ffa628de18c6ecbd6bc37938
MD5 29689e979165a71e33428276176963e8
BLAKE2b-256 bbddf49dd1d9e3ed2ba148f3157686d859f1e1399193e3eead6b22829412162f

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