Shamir Secret Sharing on paper using gfshare.
Go to file
2022-09-04 18:54:48 +02:00
.run init 2022-09-02 11:27:50 +02:00
src/paper_secret argparse 2022-09-04 18:54:48 +02:00
.gitignore init 2022-09-02 11:27:50 +02:00
create_script.py add PyPi link 2022-09-02 12:30:46 +02:00
LICENSE init 2022-09-02 11:27:50 +02:00
pyproject.toml init 2022-09-02 11:27:50 +02:00
README.md update README.md 2022-09-02 14:09:09 +02:00
requirements.txt init 2022-09-02 11:27:50 +02:00
setup.cfg argparse 2022-09-04 18:54:48 +02:00

Paper-Secret

Shamir Secret Sharing on paper using gfshare.

Installation

PyPi

Dependencies

gfshare is required to split and merge the secret. See man gfshare for an explanation of Shamir Secret Sharing in gf(2**8).

sudo pacman -S --needed libgfshare

qrencode and imagemagick (convert) are required to create and merge QR-codes during the split process. One can set the according parameters of split_encode to False to skip this step.

sudo pacman -S --needed qrencode imagemagick

enscript and ghostscript (ps2pdf) are required to create a PDF containing the split secret in text form. One can set the according parameters of split_encode to False to skip this step.

sudo pacman -S --needed enscript ghostscript

Usage

Create a secret:

cat > secret.txt

Split the secret into 5 lines:

enpaper secret.txt

Manually delete up to 2 of the 5 lines in secret.txt_txt.txt.

Then recreate the secret:

depaper secret.txt.split-text.txt

Print the secret:

cat secret.txt.split-text.txt.merged.txt

Notes

Manually reconstructing the secret from k strings:

  • For each string of the k strings
    • Create a file which name begins with part and ends with a dot and the first three characters of the string
      • For example part.112
    • Convert the 3rd to last character from base64 to binary and insert it into the file
  • Execute gfcombine part.*
  • The file part contains the reconstructed secret