HarshCasper / NeoAlgo

Bringing all Data Structures and Algorithms under one Roof âš¡
MIT License
877 stars 1.05k forks source link

Implement Shamir's Secret Sharing algorithm (cryptographic) in C-Plus-Plus #2140

Closed pganguli closed 3 years ago

pganguli commented 3 years ago

🚀 Feature

An implementation of the cryptographic algorithm, Shamir's Secret Sharing (SSS) in the C-Plus-Plus section, which allows one to generate a number of shares such that a secret is revealed only when a fixed subset of those shares are put together. See this Wikipedia article for more information.

Have you read the Contributing Guidelines on Pull Requests?

Yes, I have.

Motivation

Implementing SSS in C++ requires one to use cryptographically secure random numbers taken from a uniform distribution, support for which is natively available in C++ 11. Writing this implementation will allow the implementer to become familiar with data structures such as vectors and maps, in addition to learning about the mathematics behind this algorithm.

Pitch

An implementation of SSS can be used in situations where a cryptographic secret has to be protected by a group of people, without letting any particular individual know the secret. An example of such a case is that of an organization wishing to protect, let's say, a private key. The private key can be known by perhaps the head of that organization, but in case the head suddenly passes away, the organization has no means of recovering that private key (which might be in use for production/deployment purposes). Using SSS, the organization can distribute shares of that key among all of its high-ranking employees, such that any predefined subset of that group can come together (in case of a crisis) to reveal the secret. This way, no particular employee needs to know the secret, nor can he/she steal the secret for nefarious purposes without conspiring with all of the other required number of employees (a very unlikely situation, given the number is high enough).

pganguli commented 3 years ago

I wish to implement this for GSSOC 2021. Can this kindly be assigned to me? @atarax665

HarshCasper commented 3 years ago

Good work on the pitch!

Assigned :)

pganguli commented 3 years ago

Good work on the pitch!

Assigned :)

Thanks :D Pull request #2199 added.

pganguli commented 3 years ago

Closing, as PR #2199 has been merged.