{"id":37127732,"url":"https://github.com/ansemjo/go-shamirsplit","last_synced_at":"2026-01-14T14:52:27.203Z","repository":{"id":122757213,"uuid":"131636744","full_name":"ansemjo/go-shamirsplit","owner":"ansemjo","description":"commandline tool to split secrets / files into shares using shamir secret sharing","archived":false,"fork":false,"pushed_at":"2021-10-22T19:32:50.000Z","size":71,"stargazers_count":9,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-20T15:51:23.881Z","etag":null,"topics":["chacha20-poly1305","commandline","ed25519","protobuf","reed-solomon","shamir-secret-sharing"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ansemjo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-30T19:17:44.000Z","updated_at":"2023-11-19T10:04:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"d540cb9a-0aef-47d3-b1f3-939bd4e2e889","html_url":"https://github.com/ansemjo/go-shamirsplit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ansemjo/go-shamirsplit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fgo-shamirsplit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fgo-shamirsplit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fgo-shamirsplit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fgo-shamirsplit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansemjo","download_url":"https://codeload.github.com/ansemjo/go-shamirsplit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fgo-shamirsplit/sbom","scorecard":{"id":198061,"data":{"date":"2025-08-11","repo":{"name":"github.com/ansemjo/go-shamirsplit","commit":"8dfc45d2d03e981cdb01538571bedaa6961ad2a2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":8,"reason":"2 out of the last 2 releases have a total of 2 signed artifacts.","details":["Info: signed release artifact: shamirsplit.sig: https://github.com/ansemjo/go-shamirsplit/releases/tag/v0.1.1","Info: signed release artifact: shamirsplit_x86-64.sig: https://github.com/ansemjo/go-shamirsplit/releases/tag/v0.1","Warn: release artifact v0.1.1 does not have provenance: https://api.github.com/repos/ansemjo/go-shamirsplit/releases/10789171","Warn: release artifact v0.1 does not have provenance: https://api.github.com/repos/ansemjo/go-shamirsplit/releases/10789206"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0209 / GHSA-r5c5-pr8j-pfp7","Warn: Project is vulnerable to: GO-2023-1992 / GHSA-x3jr-pf6g-c48f","Warn: Project is vulnerable to: GO-2022-0229 / GHSA-cjjc-xp8v-855w","Warn: Project is vulnerable to: GO-2020-0012 / GHSA-ffhg-7mh4-33c4","Warn: Project is vulnerable to: GO-2021-0227 / GHSA-3vm4-22fp-5rfm","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T22:12:11.227Z","repository_id":122757213,"created_at":"2025-08-16T22:12:11.227Z","updated_at":"2025-08-16T22:12:11.227Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chacha20-poly1305","commandline","ed25519","protobuf","reed-solomon","shamir-secret-sharing"],"created_at":"2026-01-14T14:52:25.232Z","updated_at":"2026-01-14T14:52:27.191Z","avatar_url":"https://github.com/ansemjo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shamirsplit\n\nThis is a commandline program to split secrets into a number of shares where a\ncertain threshold amount is necessary to reconstruct the original secret.\n\n## Idea\n\nAfter watching [Daan Sprenkels](https://dsprenkels.com/)' 34C3 talk\n[\"We should share our secrets\"](https://dsprenkels.com/sss-34c3.html) I was\nfascinated how simple yet powerful Shamir secret sharing is. (If you need\ntechnical details on Shamir secret sharing, go watch that talk and read the\ndocumentation to the accompanying projects on [GitHub](https://github.com/dsprenkels/sss)).\n\nHowever, I soon realized that using hexadeciaml encoding and appending the entire\nciphertext to every keyshare was wasteful and\n[wanted to use](https://github.com/dsprenkels/sss-cli/issues/8) erasure coding\nwith the same threshold values to minimize the space used by shares.\n\nSometime in the future this tool may also support binary protobuf-serialized\nfiles to further minimize memory usage.\n\n## Description\n\nInformally speaking, the input data is encrypted with an authenticated\nencryption construction using a random key. The key is then split using Shamir\nsecret sharing and the ciphertext is split and encoded using Reed-Solomon\nerasure coding. The resulting shares are then signed using a signature\nalgorithm on an elliptic curve with a key derived from the same initial random\nkey.\n\nThe combination of keyshare, data share and signature is then encoded in a PEM\nformatted file, which also includes a unique UUID for easier identification of\nshards that go together. (I call the combination of key- and data shares a\n'shard'.)\n\nWhen creating shards there are two main arguments, threshold and shares. The\nlatter is the total number of shards created and threshold is the minimum number\nof shards needed to reconstruct the original data.\n\nFor an attempted visualization of the process and data flows see\n[`specification.txt`](/specification.txt).\n\nIn the spirit of \"don't roll your own crypto\", I didn't implement any of the\nprimitives used within. I merely plugged them together and hope that I didn't\nmake any grave mistakes in doing so. Some of the pieces used within:\n\n- [dspenkels/sss](https://github.com/dsprenkels/sss) - Shamir secret sharing\n- [golang/chacha20poly1305](https://godoc.org/golang.org/x/crypto/chacha20poly1305) - Authenticated Encryption with ChaCha20Poly1305\n- [golang/ed25519](https://godoc.org/golang.org/x/crypto/ed25519) - Elliptic curve signatures on Ed25519\n- [klauspost/reedsolomon](https://github.com/klauspost/reedsolomon) - Reed-Solomon erasure coding\n- [alexbakker/go-pkcs7](https://github.com/alexbakker/go-pkcs7) - PKCS7 padding\n- [golang/protobuf](github.com/golang/protobuf) - Google protobuf for efficient serialization\n- [golang/pem](https://godoc.org/encoding/pem) - PEM encoding\n\n## Installation\n\n* use `go get github.com/ansemjo/go-shamirsplit/cmd/shamirsplit`\n* or clone the repository and run `make \u0026\u0026 sudo make install`\n\n## Usage\n\nMost up-to-date usage information should always be available with\n`shamirsplit --help`. Generally there are two subcommands, `create` and\n`combine` and usage data for these subcommands is available with\n`shamirsplit \u003csubcommand\u003e --help`.\n\n### Creation\n\nIn its simplest form, data is piped into the command and the shards are output\non the console:\n\n```bash\n$ echo 'Hello, World!' | shamirsplit create -t 2 -s 3\n-----BEGIN SHARDED MESSAGE-----\nThreshold: 2\nUUID: d6204844-90ef-4f5c-8e52-f3d9f071c89f\n\nChYKENYgSESQ709cjlLz2fBxyJ8QAhgDGiEBBCYpTker/wuy0QKYvSB9KZRtwWxu\nA9W5bEIohzFVoXoiINmBXEWdOJdQ3OjZGuujkWS8mRAtxXbIL+s1ZJ0YO3/xKkBj\nGr9hIztF665uKdnlGiFUGJm1ithjp9agwPhALcEy4MXhSxaXwxZwBtK319j6XGOm\nA3EQNjF/yNLbN8fyItsOMhBNeB6VxuaX5AhX2V4hiXSZ\n-----END SHARDED MESSAGE-----\n-----BEGIN SHARDED MESSAGE-----\nThreshold: 2\nUUID: d6204844-90ef-4f5c-8e52-f3d9f071c89f\n\nChYKENYgSESQ709cjlLz2fBxyJ8QAhgDEAEaIQJ2hiK0vaAHvZqv9Oe31BfWh/3V\nptSYd/sEUS7reHXLiiIg2YFcRZ04l1Dc6Nka66ORZLyZEC3Fdsgv6zVknRg7f/Eq\nQLLaIpMWENe6U4OyamI+3ywJ4pAZ5fIVxVF2Dn1KI4Hd+dj45Rvg0JkuQyn5w+19\n1XhlX7aVY/xP82/AGZMxeAIyEMl49vZR53jMP8Vu4z+RAgI=\n-----END SHARDED MESSAGE-----\n-----BEGIN SHARDED MESSAGE-----\nThreshold: 2\nUUID: d6204844-90ef-4f5c-8e52-f3d9f071c89f\n\nChYKENYgSESQ709cjlLz2fBxyJ8QAhgDEAIaIQNY5tLi61CmJoKFpjuxcTGDf43Z\n4EsY4MXVqSzPtpzt2iIg2YFcRZ04l1Dc6Nka66ORZLyZEC3Fdsgv6zVknRg7f/Eq\nQOG1AV6ie5rfTFEXtIgIAtizHslpdVJSNyBE7QqQXXnXHOyhaRfrYJQXk0bF5Q8Y\nI8FXtOtno8Jf7XBAqxjhgw4yEFh401P15FS0Zm6qOR25mLI=\n-----END SHARDED MESSAGE-----\n```\n\nTo make splitting easier, a null-byte can be appended after each PEM block with\n`-0/--null`. While-read loops or GNU split can then delimit on that null-byte:\n\n```bash\n$ echo 'Hello, World!' | shamirsplit create -t 2 -s 3 -0 |\\\n while read -d $'\\0' shard; do echo \"$shard\" \u003e shard.$((i++)); done\n```\n\n```bash\n$ echo 'Hello, World!' | shamirsplit create -t 2 -s 3 -0 | split -l1 -t'\\0' -d - \"shard.\"\n```\n\n_Note however_ that you need to remove the null-bytes from the output files\nmanually in case you use `split`. Otherwise `shamirsplit combine` will only read\nthe first shard and then complain about missing shards.\n\nAlternatively use the `-d/--directory` and `-n/--name` arguments to write the\nshards to files in a directory directly:\n\n```bash\n$ echo 'Hello, World!' | shamirsplit create -t 2 -s 3 -d /tmp -n testingshard\n/tmp/testingshard_000.pem\n/tmp/testingshard_001.pem\n/tmp/testingshard_002.pem\n```\n\n### Combination\n\nTo combine shards at a later point in time, concatenate and pipe all the shards\nthat you have in any order. If you have more valid shards than the threshold,\nthe original data will be reconstructed.\n\n___Note:___ upon verification the first shard given is assumed to be \"your\" shard\nand its embedded public key will be used to verify the signatures on all shards.\nSince this provides integrity you should take care to always pipe your own shard\nfirst.\n\n```bash\n$ rm /tmp/testingshard_001.pem \nrm: remove regular file '/tmp/testingshard_001.pem'? y\n$ cat /tmp/testingshard_00{2,0}.pem | shamirsplit combine\nHello, World!\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansemjo%2Fgo-shamirsplit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansemjo%2Fgo-shamirsplit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansemjo%2Fgo-shamirsplit/lists"}