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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: horcrux-1.0.3.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for horcrux-1.0.3.tar.gz
Algorithm Hash digest
SHA256 bb05e9d8a400488dd247e3d50bba32bfed380cab5778e72874899df3434eb103
MD5 7758045e676c9773087acb0bd463bd80
BLAKE2b-256 df60a72510b880cc3afbaf3b3f9fb9e1edcf812b782ff86083361a57b4ad93d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: horcrux-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for horcrux-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 150a0ebefe10fb7f322500b7f376eaa60a5640def8d8741290460c4fbb074bcb
MD5 ea7dde37f85a70510ff1650f803539f5
BLAKE2b-256 502bc2796478da12de7f14a5d3aa26e5f322631af6c354749fae1958f0c2b571

See more details on using hashes here.

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