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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for horcrux-1.0.6.tar.gz
Algorithm Hash digest
SHA256 6bb90dab64592518217204c0a72f138c74183838443daec3a140beb837e5d757
MD5 8de12102b67370ce085a38fb30eb5395
BLAKE2b-256 5083e8efc11e59967fcc32c9da1f3bab04c47407613422233c17248f0501bccd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for horcrux-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 14919cbfcd1f6c4748e073caf57a28d33c4d5970f41c8242f0d7c1389732c518
MD5 159f10ddd1c95ca342941d9b0b8b9ba5
BLAKE2b-256 fb4cb969980f7fe9692327d518441e1c23f5de25783ea4005f9b274d9a36fbb2

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