{"id":21328986,"url":"https://github.com/dsprenkels/sss-go","last_synced_at":"2025-07-12T08:32:16.925Z","repository":{"id":23500543,"uuid":"93312739","full_name":"dsprenkels/sss-go","owner":"dsprenkels","description":"Go bindings for my shamir-secret-sharing library","archived":false,"fork":false,"pushed_at":"2021-12-03T20:51:38.000Z","size":45,"stargazers_count":19,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T04:04:53.388Z","etag":null,"topics":["cryptography","shamir-secret-sharing"],"latest_commit_sha":null,"homepage":"","language":"C","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/dsprenkels.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}},"created_at":"2017-06-04T12:42:28.000Z","updated_at":"2024-05-02T19:01:07.000Z","dependencies_parsed_at":"2022-07-25T13:32:15.480Z","dependency_job_id":null,"html_url":"https://github.com/dsprenkels/sss-go","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsprenkels%2Fsss-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsprenkels%2Fsss-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsprenkels%2Fsss-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsprenkels%2Fsss-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsprenkels","download_url":"https://codeload.github.com/dsprenkels/sss-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225809021,"owners_count":17527425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cryptography","shamir-secret-sharing"],"created_at":"2024-11-21T21:46:54.850Z","updated_at":"2024-11-21T21:46:55.387Z","avatar_url":"https://github.com/dsprenkels.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shamir secret sharing with Go\n\n[![Build Status](https://travis-ci.org/dsprenkels/sss-go.svg?branch=master)](https://travis-ci.org/dsprenkels/sss-go)\n\n`sss-go` contains Go bindings for my [Shamir secret sharing library][sss].\nThis library allows users to split secret data into a number of different\nshares. With the possession of some or all of these shares, the original secret\ncan be restored.\n\nAn example use case is a beer brewery which has a vault which contains their\nprecious super secret recipe. The 5 board members of this brewery do not trust\nall the others well enough that they won't secretly break into the vault and\nsell the recipe to a competitor. So they split the code into 5 shares, and\nallow 4 shares to restore the original code. Now they are sure that the\nmajority of the staff will know when the vault is opened, but they can still\nopen the vault when one of the staff members is abroad or sick at home.\n\n## Installation\n\n```shell\ngo get github.com/dsprenkels/sss-go\n```\n\n## Usage\n\nSecrets are provided as `[]byte` slices with a length of 64. Shares are\ngenerated from secret data using `sss.CreateShares` and shares can be combined\nagain using the `sss.CombineShares` function. Shares are always 113 bytes long\nand `sss.CombineShares` will return an error if one of the given shares is of\nan invalid length.\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"github.com/dsprenkels/sss-go\"\n)\n\nfunc main() {\n    // Make a new slice of secret data [42, ..., 42]\n    data := make([]byte, 64)\n    for i, _ := range data {\n        data[i] = 42\n    }\n\n    // Create 5 shares; allow 4 to restore the original data\n    shares, err := sss.CreateShares(data, 5, 4)\n    if err != nil {\n        log.Fatalln(err)\n    }\n\n    // Permute and lose some of the shares (for demonstrational purposes)\n    new_shares := make([][]byte, 4)\n    new_shares[0] = shares[2]\n    new_shares[1] = shares[4]\n    new_shares[2] = shares[0]\n    new_shares[3] = shares[3]\n\n    // Try to restore the original secret\n    restored, err := sss.CombineShares(new_shares)\n    if err != nil {\n        log.Fatalln(err)\n    }\n\n    log.Println(restored)\n}\n```\n\n## Changelog\n\n### Version 0.1.1\n\n- Remove an unintended side channel which allows a participating attacker with\n  access to a accurate timing channel to iteratively guess shares during the\n  execution of `combine_shares`.\n\n## Questions\n\nFeel free to send me an email on my Github associated e-mail address.\n\n[randombytes]: https://github.com/dsprenkels/randombytes\n[sss]: https://github.com/dsprenkels/sss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsprenkels%2Fsss-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsprenkels%2Fsss-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsprenkels%2Fsss-go/lists"}