add PyPi link

This commit is contained in:
Daniel Langbein 2022-09-02 12:30:46 +02:00
parent 125f5c968f
commit d2dae5faa0
2 changed files with 39 additions and 0 deletions

View File

@ -4,6 +4,12 @@ Shamir Secret Sharing on paper using gfshare.
## Installation ## Installation
### PyPi
* https://pypi.org/project/paper-secret/
### Dependencies
`gfshare` is required to split and merge the secret. `gfshare` is required to split and merge the secret.
See `man gfshare` for an explanation of Shamir Secret Sharing in gf(2**8). See `man gfshare` for an explanation of Shamir Secret Sharing in gf(2**8).

33
create_script.py Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pathlib import Path
def main():
"""
Creates two single-file python executables `enpaper` and `depaper`.
One can use this method as an alternative to an installation from PyPi.
"""
package = Path() / 'src' / 'paper_secret'
util = package / 'util.py'
enpaper_files = [util, package / 'enpaper.py']
depaper_files = [util, package / 'depaper.py']
create_script(enpaper_files, Path('enpaper'))
create_script(depaper_files, Path('depaper'))
def create_script(files: list[Path], dst: Path):
text = '\n'.join([file.read_text() for file in files])
text = text.replace('import paper_secret.util as util', '')
text = text.replace('util.execute_stdin_capture', 'execute_stdin_capture')
dst.write_text(text)
dst.chmod(0o755)
if __name__ == '__main__':
main()