{"id":31923656,"url":"https://github.com/fletcher/c-sss","last_synced_at":"2025-10-13T23:56:14.858Z","repository":{"id":33763943,"uuid":"37419562","full_name":"fletcher/c-sss","owner":"fletcher","description":"Implementation of Shamir's Secret Sharing in C","archived":false,"fork":false,"pushed_at":"2024-07-25T23:30:16.000Z","size":319,"stargazers_count":65,"open_issues_count":1,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-07-26T01:41:45.244Z","etag":null,"topics":["cryptography","secret","shamir"],"latest_commit_sha":null,"homepage":"http://fletcher.github.io/c-sss/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fletcher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2015-06-14T16:16:04.000Z","updated_at":"2024-05-04T08:51:36.000Z","dependencies_parsed_at":"2024-07-26T01:44:36.807Z","dependency_job_id":null,"html_url":"https://github.com/fletcher/c-sss","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/fletcher/c-sss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcher%2Fc-sss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcher%2Fc-sss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcher%2Fc-sss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcher%2Fc-sss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fletcher","download_url":"https://codeload.github.com/fletcher/c-sss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcher%2Fc-sss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017193,"owners_count":26086017,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cryptography","secret","shamir"],"created_at":"2025-10-13T23:55:39.471Z","updated_at":"2025-10-13T23:56:14.853Z","avatar_url":"https://github.com/fletcher.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About ##\n\n|            |                           |  \n| ---------- | ------------------------- |  \n| Title:     | c-SSS        |  \n| Author:    | Fletcher T. Penney       |  \n| Date:      | 2020-07-27 |  \n| Copyright: | Copyright © 2015-2018, 2020 Fletcher T. Penney.    |  \n| Version:   | 0.2.5      |  \n\n\n## Introduction ##\n\nThis is an implementation of [Shamir's Secret Sharing][shamir].  It was\nimplemented in original c code, based on the javascript example from\nWikipedia, with a couple of utility routines based on code elsewhere\non the internet.\n\nAs long as it's compiled from source, and you verify the source, you can\nbe confident that nothing nefarious is being done with your information.\n\nThe idea is that a secret string (e.g. a password, a secret note, etc.)\nis encoded and divided up into a specified number of shares (n). You also\nspecify the threshold number of shares required to be able to reconstruct\nthe original secret (t).\n\nFor example, you can split the secret into three shares, but require only\ntwo of them to recreate the secret.  This means that if one of the shares\nis lost, or otherwise unavailable, the secret can still be recovered. One\nof the shares, without either of the other two, is useless.\n\nThis means that if someone gains access to one, but not two, of the shares,\nthey cannot recover any information about the information that was\nencrypted.\n\n\n## How is it used? ##\n\nYou have a few options:\n\n\t./shamir \"Some secret to be encrypted\" 3 2 \u003e all-keys.txt\n\nThis will encrypt the string and generate 3 shares, any 2 of which are required \nto unlock the secret.  They are written to `all-keys.txt`.  This file should\nimmediately be separated, since all of the keys together can be used to \ndecrypt the secret.\n\n\t./shamir 3 2 \u003c secret.txt\n\nThis pulls the secret from a text file\n\n\nThe easiest way to unlock the information is to place the required keys in a\ntext file, with each key on a line by itself.  Each key should be at the\nbeginning of the line.\n\n\t./shamir \u003c keys.txt\n\nThis reads the keys from `keys.txt` and uses them to decrypt the secret, \nwhich is then output on stdout.\n\n\n## The Shares ##\n\nEach share looks like this:\n\n\t0102AA05C0DF2BD6\n\nThe first two characters indicate the number of the share (in hex). The\nnext two characters indicate how many shares are required to decrypt the\nsecret (again in hex).  The next two characters (`AA`), are fake and enable\nthe shares to also be used on a website:\n\n\u003chttp://www.christophedavid.org/w/c/w.php/Calculators/ShamirSecretSharing\u003e\n\nI cannot vouch for the security of this website -- it claims not to send\nany of your information over the internet, but that may or may not be true.\n\n\n## About the Source ##\n\nThis project was based on my [c-template] project.  It includes some boilerplate setup to make it easy to incorporate:\n\n* [cmake] for build configuration\n* [CuTest] for unit testing\n* [doxygen] for creating documentation from source files\n\n[c-template]:\thttps://github.com/fletcher/c-template\n[cmake]:\thttp://www.cmake.org/\n[CuTest]:\thttp://cutest.sourceforge.net\n[doxygen]:\thttp://www.stack.nl/~dimitri/doxygen/\n\n\n## Security Issues ##\n\nI am not a cryptologist.  From what I can gather from the internet, Shamir's\nalgorithm is secure -- without a sufficient number of shares, you cannot\n\"crack the code.\"  I *believe* that I have implemented the algorithm correctly,\nbased on what I can read and the fact that it generates compatible results\nwith another implementation.\n\nBecause the secret is encrypted one character at a time, you can use the \nlength of the shares to determine the length of the secret.  Depending on\nyour needs, you could pad the secret with spaces to obscure the actual\nlength.\n\nNaturally, you have to protect the shares as you would the password, especially\nwhen you have all of them together.\n\nI do not do anything special with the code to guard against any attacks on \nyour machine, such as trying to read memory that was used by the application.\nIf someone has (reasonable) suggestions, I am happy to implement them.  But \nmy intent was not to create something that will guard against motivated\nattackers with significant resources.\n\nTo the best of my knowledge, this program is reasonably safe to use.  You can\nreadily view the source to ensure that your information is not being sent over\nthe internet or saved to other files.  But ultimately, it's your responsibility\nto use the software carefully.\n\nIf you discover any problems with the program, please let me know!\n\n\n[shamir]:\thttp://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing\n\n\n## Source ##\n\nThe source is available online:\n\n\u003chttps://github.com/fletcher/c-sss\u003e\n\n\n## Documentation ##\n\nFull documentation is available online:\n\n\u003chttp://fletcher.github.io/c-sss/index.html\u003e\n\n\n## License ##\n\nThe `c-sss` project is released under the MIT License.\n\nGLibFacade.c and GLibFacade.h are from the MultiMarkdown v4 project:\n\n\thttps://github.com/fletcher/MultiMarkdown-4/\n\nMMD 4 is released under both the MIT License and GPL.\n\n\nCuTest is released under the zlib/libpng license. See CuTest.c for the text\nof the license.\n\n\n## The MIT License ##\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffletcher%2Fc-sss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffletcher%2Fc-sss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffletcher%2Fc-sss/lists"}