wolfsoftware.shamir-secret-sharing


Namewolfsoftware.shamir-secret-sharing JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/GreyTeamToolbox/shamir-secret-sharing-package
SummaryA CLI implementation of Shamir's secret sharing.
upload_time2024-07-01 09:09:35
maintainerNone
docs_urlNone
authorWolf Software
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable -->
<p align="center">
    <a href="https://github.com/GreyTeamToolbox/">
        <img src="https://cdn.wolfsoftware.com/assets/images/github/organisations/greyteamtoolbox/black-and-white-circle-256.png" alt="GreyTeamToolbox logo" />
    </a>
    <br />
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/actions/workflows/cicd.yml">
        <img src="https://img.shields.io/github/actions/workflow/status/GreyTeamToolbox/shamir-secret-sharing-package/cicd.yml?branch=master&label=build%20status&style=for-the-badge" alt="Github Build Status" />
    </a>
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/blob/master/LICENSE.md">
        <img src="https://img.shields.io/github/license/GreyTeamToolbox/shamir-secret-sharing-package?color=blue&label=License&style=for-the-badge" alt="License">
    </a>
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package">
        <img src="https://img.shields.io/github/created-at/GreyTeamToolbox/shamir-secret-sharing-package?color=blue&label=Created&style=for-the-badge" alt="Created">
    </a>
    <br />
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/releases/latest">
        <img src="https://img.shields.io/github/v/release/GreyTeamToolbox/shamir-secret-sharing-package?color=blue&label=Latest%20Release&style=for-the-badge" alt="Release">
    </a>
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/releases/latest">
        <img src="https://img.shields.io/github/release-date/GreyTeamToolbox/shamir-secret-sharing-package?color=blue&label=Released&style=for-the-badge" alt="Released">
    </a>
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/releases/latest">
        <img src="https://img.shields.io/github/commits-since/GreyTeamToolbox/shamir-secret-sharing-package/latest.svg?color=blue&style=for-the-badge" alt="Commits since release">
    </a>
    <br />
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/blob/master/.github/CODE_OF_CONDUCT.md">
        <img src="https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge" />
    </a>
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/blob/master/.github/CONTRIBUTING.md">
        <img src="https://img.shields.io/badge/Contributing-blue?style=for-the-badge" />
    </a>
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/blob/master/.github/SECURITY.md">
        <img src="https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge" />
    </a>
    <a href="https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/issues">
        <img src="https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge" />
    </a>
</p>

## Overview

[Shamir's secret sharing (SSS)](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing) is an efficient secret sharing algorithm for distributing
private information (the "secret") among a group. The secret cannot be revealed unless a quorum of the group acts together to pool their knowledge.

To achieve this, the secret is mathematically divided into parts (the "shares") from which the secret can be reassembled only when a sufficient
number of shares are combined. SSS has the property of information-theoretic security, meaning that even if an attacker steals some shares, it is
impossible for the attacker to reconstruct the secret unless they have stolen the quorum number of shares.

## Installation

```sh
pip install wolfsoftware.shamir-secret-sharing
```

## Command Line Usage

```sh
usage: shamir-secret-sharing [-h] [-V] [-s SHARES] [-t THRESHOLD] [-o] (-c CREATE | -r SHARE [SHARE ...])

Shamir's Secret Sharing CLI

flags:
  -h, --help            Show this help message and exit
  -V, --version         Show program's version number and exit.

optional:
  -s SHARES, --shares SHARES
                        Total number of shares to create (default: None)
  -t THRESHOLD, --threshold THRESHOLD
                        Threshold number of shares needed to reconstruct the secret (default: None)
  -o, --output          Output shares to screen instead of writing to files (default: False)

required:
  -c CREATE, --create CREATE
                        The secret to share or the file containing the secret (default: None)
  -r SHARE [SHARE ...], --reconstruct SHARE [SHARE ...]
                        List of shares in the form "x,y" or file paths ending with .txt (default: None)
```

### Creating Shares

```sh
shamir-secret-sharing -c "mysupersecretpassword" -s 5 -t 3
```

### Reconstructing the Secret

```sh
shamir-secret-sharing -r share-1.txt share-3.txt share-5.txt
```

## Limitations

Secrets are limited to a max size of `4096 bytes`. If you have a secret which is larger than that, then we recommend you split it into 4K blocks
and then use this tool per block, and when you reconstruct the file parts then you can simply reconstruct the original file from there.

### Splitting Large files

```sh
split -b 4096 original_file block_
```

### Reconstructing the File from 4K Blocks

```sh
cat block_* > reconstructed_file
```

<br />
<p align="right"><a href="https://wolfsoftware.com/"><img src="https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge" /></a></p>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/GreyTeamToolbox/shamir-secret-sharing-package",
    "name": "wolfsoftware.shamir-secret-sharing",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Wolf Software",
    "author_email": "pypi@wolfsoftware.com",
    "download_url": "https://files.pythonhosted.org/packages/89/a2/1f4b8666b6096f010361bad04725dfd1d049292bb7910a5abc4ba3d400c9/wolfsoftware_shamir_secret_sharing-0.1.3.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable -->\n<p align=\"center\">\n    <a href=\"https://github.com/GreyTeamToolbox/\">\n        <img src=\"https://cdn.wolfsoftware.com/assets/images/github/organisations/greyteamtoolbox/black-and-white-circle-256.png\" alt=\"GreyTeamToolbox logo\" />\n    </a>\n    <br />\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/actions/workflows/cicd.yml\">\n        <img src=\"https://img.shields.io/github/actions/workflow/status/GreyTeamToolbox/shamir-secret-sharing-package/cicd.yml?branch=master&label=build%20status&style=for-the-badge\" alt=\"Github Build Status\" />\n    </a>\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/blob/master/LICENSE.md\">\n        <img src=\"https://img.shields.io/github/license/GreyTeamToolbox/shamir-secret-sharing-package?color=blue&label=License&style=for-the-badge\" alt=\"License\">\n    </a>\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package\">\n        <img src=\"https://img.shields.io/github/created-at/GreyTeamToolbox/shamir-secret-sharing-package?color=blue&label=Created&style=for-the-badge\" alt=\"Created\">\n    </a>\n    <br />\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/releases/latest\">\n        <img src=\"https://img.shields.io/github/v/release/GreyTeamToolbox/shamir-secret-sharing-package?color=blue&label=Latest%20Release&style=for-the-badge\" alt=\"Release\">\n    </a>\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/releases/latest\">\n        <img src=\"https://img.shields.io/github/release-date/GreyTeamToolbox/shamir-secret-sharing-package?color=blue&label=Released&style=for-the-badge\" alt=\"Released\">\n    </a>\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/releases/latest\">\n        <img src=\"https://img.shields.io/github/commits-since/GreyTeamToolbox/shamir-secret-sharing-package/latest.svg?color=blue&style=for-the-badge\" alt=\"Commits since release\">\n    </a>\n    <br />\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/blob/master/.github/CODE_OF_CONDUCT.md\">\n        <img src=\"https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge\" />\n    </a>\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/blob/master/.github/CONTRIBUTING.md\">\n        <img src=\"https://img.shields.io/badge/Contributing-blue?style=for-the-badge\" />\n    </a>\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/blob/master/.github/SECURITY.md\">\n        <img src=\"https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge\" />\n    </a>\n    <a href=\"https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/issues\">\n        <img src=\"https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge\" />\n    </a>\n</p>\n\n## Overview\n\n[Shamir's secret sharing (SSS)](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing) is an efficient secret sharing algorithm for distributing\nprivate information (the \"secret\") among a group. The secret cannot be revealed unless a quorum of the group acts together to pool their knowledge.\n\nTo achieve this, the secret is mathematically divided into parts (the \"shares\") from which the secret can be reassembled only when a sufficient\nnumber of shares are combined. SSS has the property of information-theoretic security, meaning that even if an attacker steals some shares, it is\nimpossible for the attacker to reconstruct the secret unless they have stolen the quorum number of shares.\n\n## Installation\n\n```sh\npip install wolfsoftware.shamir-secret-sharing\n```\n\n## Command Line Usage\n\n```sh\nusage: shamir-secret-sharing [-h] [-V] [-s SHARES] [-t THRESHOLD] [-o] (-c CREATE | -r SHARE [SHARE ...])\n\nShamir's Secret Sharing CLI\n\nflags:\n  -h, --help            Show this help message and exit\n  -V, --version         Show program's version number and exit.\n\noptional:\n  -s SHARES, --shares SHARES\n                        Total number of shares to create (default: None)\n  -t THRESHOLD, --threshold THRESHOLD\n                        Threshold number of shares needed to reconstruct the secret (default: None)\n  -o, --output          Output shares to screen instead of writing to files (default: False)\n\nrequired:\n  -c CREATE, --create CREATE\n                        The secret to share or the file containing the secret (default: None)\n  -r SHARE [SHARE ...], --reconstruct SHARE [SHARE ...]\n                        List of shares in the form \"x,y\" or file paths ending with .txt (default: None)\n```\n\n### Creating Shares\n\n```sh\nshamir-secret-sharing -c \"mysupersecretpassword\" -s 5 -t 3\n```\n\n### Reconstructing the Secret\n\n```sh\nshamir-secret-sharing -r share-1.txt share-3.txt share-5.txt\n```\n\n## Limitations\n\nSecrets are limited to a max size of `4096 bytes`. If you have a secret which is larger than that, then we recommend you split it into 4K blocks\nand then use this tool per block, and when you reconstruct the file parts then you can simply reconstruct the original file from there.\n\n### Splitting Large files\n\n```sh\nsplit -b 4096 original_file block_\n```\n\n### Reconstructing the File from 4K Blocks\n\n```sh\ncat block_* > reconstructed_file\n```\n\n<br />\n<p align=\"right\"><a href=\"https://wolfsoftware.com/\"><img src=\"https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge\" /></a></p>\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A CLI implementation of Shamir's secret sharing.",
    "version": "0.1.3",
    "project_urls": {
        "Documentation": "https://github.com/GreyTeamToolbox/shamir-secret-sharing-package",
        "Homepage": "https://github.com/GreyTeamToolbox/shamir-secret-sharing-package",
        "Source": "https://github.com/GreyTeamToolbox/shamir-secret-sharing-package",
        "Sponsor": "https://github.com/sponsors/WolfSoftware",
        "Tracker": "https://github.com/GreyTeamToolbox/shamir-secret-sharing-package/issues/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b96ea58d1d46ba8e7ae49f3299dea83dbda58ae7b0ef1c93a452cd3db584ddbb",
                "md5": "badd86cb702dc16233cbcc701c422db0",
                "sha256": "0e879ed15bb40b84952d0b7b38cab5350c19282ff49715060c56b83cb9602107"
            },
            "downloads": -1,
            "filename": "wolfsoftware.shamir_secret_sharing-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "badd86cb702dc16233cbcc701c422db0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 14506,
            "upload_time": "2024-07-01T09:09:34",
            "upload_time_iso_8601": "2024-07-01T09:09:34.285487Z",
            "url": "https://files.pythonhosted.org/packages/b9/6e/a58d1d46ba8e7ae49f3299dea83dbda58ae7b0ef1c93a452cd3db584ddbb/wolfsoftware.shamir_secret_sharing-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "89a21f4b8666b6096f010361bad04725dfd1d049292bb7910a5abc4ba3d400c9",
                "md5": "eeec9f1385639abc012f95938c20541d",
                "sha256": "d6cba19786c49bd979377d13aed725f48d482d720c92e84c8bf0ece1fb350b8f"
            },
            "downloads": -1,
            "filename": "wolfsoftware_shamir_secret_sharing-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "eeec9f1385639abc012f95938c20541d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 13959,
            "upload_time": "2024-07-01T09:09:35",
            "upload_time_iso_8601": "2024-07-01T09:09:35.854400Z",
            "url": "https://files.pythonhosted.org/packages/89/a2/1f4b8666b6096f010361bad04725dfd1d049292bb7910a5abc4ba3d400c9/wolfsoftware_shamir_secret_sharing-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-01 09:09:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GreyTeamToolbox",
    "github_project": "shamir-secret-sharing-package",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "wolfsoftware.shamir-secret-sharing"
}
        
Elapsed time: 4.52150s