Skip to content

lukakilic/sssafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sssafe

A self-contained HTML file for splitting secrets using Shamir's Secret Sharing.

Basically a UI on top of privy-io/shamir-secret-sharing, inspired by iancoleman/shamir.

Share format

Each share is a self-describing string:

id:threshold:total:group:hex
  • id — which share this is
  • threshold — minimum shares required to reconstruct
  • total — total shares this secret was split into
  • group — random ID shared across all shares from the same split, to detect mixing of unrelated shares
  • hex — the share data

For example, 2:3:5:a1b2c3d4:ff023a... means: share 2, need 3 of 5, group a1b2c3d4.

Note: This format is for convenience — it tells you how many shares are needed and lets you group shares by ID. To recover a secret, only the hex share data is strictly required. The recover box accepts both formats; when recovering, use one consistently.

Usage

Download sssafe.html from Releases, or build it yourself:

docker build -t sssafe .
docker run --rm sssafe > sssafe.html

and open it in your browser.

Notes

Checksum

A checksum is embedded in the secret before splitting and verified after reconstruction — catching corrupted or mismatched shares before showing any output.

split(secret):
  payload  = SHA256(secret)[0:4] + secret
  shares   = shamir_split(payload)

recover(shares):
  payload  = shamir_join(shares)
  checksum = payload[0:4]
  secret   = payload[4:]
  assert SHA256(secret)[0:4] == checksum
  return secret

About

A self-contained HTML file for splitting secrets using Shamir's Secret Sharing.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors