Skip to content

Sharing secrets

Introduction

In the case of a temporary or permanent catastrophe, it would be good to have a system in place to share secrets with e.g. your spouse or a 3rd party. This could be the password and backup code for a password manager, or a key to an encrypted digital testament.

One way to do this is to split that password or key into N parts and distribute them to N trusted people. You also define how many K people are needed to reconstruct the secret. One of the more known algorithm to do this is called the Shamir Secret Sharing (SSS) algorithm.

Shamir Secret Sharing

SSS (Shamir's secret sharing) is used to secure a secret in a distributed form, most often to secure encryption keys. The secret is split into multiple shares, which individually do not give any information about the secret.

To reconstruct a secret secured by SSS, a number of shares is needed, called the threshold. No information about the secret can be gained from any number of shares below the threshold (a property called perfect secrecy).

wikipedia.org

Test it out here: iancoleman.io/shamir

Code implementations

Repo Language Stars
jesseduffield/horcrux Go GitHub Repo stars
shea256/secret-sharing Python GitHub Repo stars
dsprenkels/sss C GitHub Repo stars
paritytech/banana_split Javascript GitHub Repo stars
iancoleman/shamir Javascript GitHub Repo stars
timtiemens/secretshare Java GitHub Repo stars
corvus-ch/shamir Go GitHub Repo stars
teqneers/shamir PHP GitHub Repo stars
kurtbrose/shamir Python GitHub Repo stars
shamir_secret_sharing Rust