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

Uploaded Python 3

File details

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

File metadata

  • Download URL: horcrux-1.0.4.tar.gz
  • Upload date:
  • Size: 10.8 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.4.tar.gz
Algorithm Hash digest
SHA256 737aa25529de84ee94145ce81564563aaff0eedf4bc29c152cb30450d2f09a3b
MD5 ca4e5a3aedb05e4eac742974345ac1b8
BLAKE2b-256 10233ddbd19724e496ae7ec2c441ea0b11c5d319950432491fe683ddde5a8556

See more details on using hashes here.

File details

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

File metadata

  • Download URL: horcrux-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 59e7daaee558565caff35b704ae417e5e3ed322cf2880e68cf3c552830b16cf3
MD5 a01f649561cf834b68023e2e3e464072
BLAKE2b-256 3c61b466351ecff80a21b7858de129ffb9554c7b076b6b4f4db3b2aac8b4237e

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