mirror of
https://codeberg.org/privacy1st/paper-secret
synced 2024-12-22 23:56:05 +01:00
add PyPi link
This commit is contained in:
parent
125f5c968f
commit
d2dae5faa0
@ -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
33
create_script.py
Executable 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()
|
Loading…
Reference in New Issue
Block a user