2022-09-02 11:27:50 +02:00
|
|
|
# Paper-Secret
|
|
|
|
|
|
|
|
Shamir Secret Sharing on paper using gfshare.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2022-09-02 12:30:46 +02:00
|
|
|
### PyPi
|
|
|
|
|
|
|
|
* https://pypi.org/project/paper-secret/
|
|
|
|
|
|
|
|
### Dependencies
|
|
|
|
|
2022-09-02 11:27:50 +02:00
|
|
|
`gfshare` is required to split and merge the secret.
|
|
|
|
See `man gfshare` for an explanation of Shamir Secret Sharing in gf(2**8).
|
|
|
|
|
|
|
|
```shell
|
|
|
|
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.
|
|
|
|
|
|
|
|
```shell
|
|
|
|
sudo pacman -S --needed qrencode imagemagick
|
|
|
|
```
|
|
|
|
|
2022-09-02 13:27:24 +02:00
|
|
|
`enscript` and `ghostscript` (`ps2pdf`) are required to create a PDF containing the split secret in text form.
|
2022-09-02 11:27:50 +02:00
|
|
|
One can set the according parameters of `split_encode` to `False` to skip this step.
|
|
|
|
|
|
|
|
```shell
|
2022-09-02 13:27:24 +02:00
|
|
|
sudo pacman -S --needed enscript ghostscript
|
2022-09-02 11:27:50 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Create a secret:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
cat > secret.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
Split the secret into 5 lines:
|
|
|
|
|
|
|
|
```shell
|
2022-09-02 13:27:24 +02:00
|
|
|
enpaper secret.txt
|
2022-09-02 11:27:50 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Manually delete up to 2 of the 5 lines in `secret.txt_txt.txt`.
|
|
|
|
|
|
|
|
Then recreate the secret:
|
|
|
|
|
|
|
|
```shell
|
2022-09-02 13:27:24 +02:00
|
|
|
depaper secret.txt.split-text.txt
|
2022-09-02 11:27:50 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Print the secret:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
cat secret.txt.split-text.txt.merged.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
* https://en.wikipedia.org/Shamir's_Secret_Sharing
|