mirror of
https://codeberg.org/privacy1st/paper-secret
synced 2024-12-22 23:56:05 +01:00
more arguments; update README.md
This commit is contained in:
parent
e4f63e8971
commit
d4b74c1810
10
README.md
10
README.md
@ -10,7 +10,9 @@ Shamir Secret Sharing on paper using gfshare.
|
||||
|
||||
### Dependencies
|
||||
|
||||
`gfshare` is required to split and merge the secret.
|
||||
Required and optional dependencies with example how to install them for Arch Linux.
|
||||
|
||||
`gfshare` is required to split (`enpaper`) and merge (`depaper`) the secret.
|
||||
See `man gfshare` for an explanation of Shamir Secret Sharing in gf(2**8).
|
||||
|
||||
```shell
|
||||
@ -18,14 +20,14 @@ 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.
|
||||
One can pass `-q` to `enpapaer` to skip this step.
|
||||
|
||||
```shell
|
||||
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.
|
||||
One can pass `-t` to `enpaper` to skip this step.
|
||||
|
||||
```shell
|
||||
sudo pacman -S --needed enscript ghostscript
|
||||
@ -33,7 +35,7 @@ sudo pacman -S --needed enscript ghostscript
|
||||
|
||||
## Usage
|
||||
|
||||
Create a secret:
|
||||
Create a file with secret content:
|
||||
|
||||
```shell
|
||||
cat > secret.txt
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
[metadata]
|
||||
name = paper-secret
|
||||
version = 0.1.2
|
||||
version = 0.1.3
|
||||
author = Daniel Langbein
|
||||
author_email = daniel@systemli.org
|
||||
description = Shamir Secret Sharing on paper using gfshare
|
||||
|
@ -16,10 +16,16 @@ def main():
|
||||
action='store_false', default=True)
|
||||
parser.add_argument('--no-text-pdf', '-t', help='skip text-PDF generation',
|
||||
action='store_false', default=True)
|
||||
parser.add_argument('--num-shares', '-n', help='number of shares to generate',
|
||||
default=5, type=int)
|
||||
parser.add_argument('--threshold', '-k', help='threshold for recombination',
|
||||
default=3, type=int)
|
||||
#
|
||||
args = parser.parse_args()
|
||||
|
||||
split_encode(secret=args.secret,
|
||||
k=args.threshold,
|
||||
n=args.num_shares,
|
||||
create_qr_codes=args.no_qr,
|
||||
create_text_pdf=args.no_text_pdf)
|
||||
|
||||
@ -47,6 +53,7 @@ def split_encode(
|
||||
:param n: Number of shares to generate
|
||||
:return: List of created files.
|
||||
"""
|
||||
assert n > k
|
||||
assert secret.exists(), str(secret)
|
||||
assert secret.is_file(), str(secret)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user