This commit is contained in:
Daniel Langbein 2022-09-04 18:54:48 +02:00
parent c2f292bd5b
commit e4f63e8971
3 changed files with 25 additions and 7 deletions

View File

@ -3,7 +3,7 @@
[metadata] [metadata]
name = paper-secret name = paper-secret
version = 0.1.1 version = 0.1.2
author = Daniel Langbein author = Daniel Langbein
author_email = daniel@systemli.org author_email = daniel@systemli.org
description = Shamir Secret Sharing on paper using gfshare description = Shamir Secret Sharing on paper using gfshare

View File

@ -1,15 +1,21 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import argparse
import base64 import base64
import tempfile import tempfile
from pathlib import Path from pathlib import Path
import sys
import paper_secret.util as util import paper_secret.util as util
def main(): def main():
assert len(sys.argv) == 2, 'Expected one argument' parser = argparse.ArgumentParser(prog='depaper (paper-secret)')
merge_decode(Path(sys.argv[1])) #
parser.add_argument('src', type=Path,
help='a file with at least k non-empty lines')
#
args = parser.parse_args()
merge_decode(src=args.src)
def merge_decode(src: Path) -> Path: def merge_decode(src: Path) -> Path:

View File

@ -1,15 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import argparse
import base64 import base64
import tempfile import tempfile
from pathlib import Path from pathlib import Path
import sys
import paper_secret.util as util import paper_secret.util as util
def main(): def main():
assert len(sys.argv) == 2, 'Expected one argument' parser = argparse.ArgumentParser(prog='enpaper (paper-secret)')
split_encode(Path(sys.argv[1])) #
parser.add_argument('secret', type=Path,
help='file containing a secret')
parser.add_argument('--no-qr', '-q', help='skip QR-code generation',
action='store_false', default=True)
parser.add_argument('--no-text-pdf', '-t', help='skip text-PDF generation',
action='store_false', default=True)
#
args = parser.parse_args()
split_encode(secret=args.secret,
create_qr_codes=args.no_qr,
create_text_pdf=args.no_text_pdf)
def split_encode( def split_encode(