https://github.com/charles-hsiao/python-blakley-secret-sharing-scheme
Blakley's secret sharing scheme python implementation
https://github.com/charles-hsiao/python-blakley-secret-sharing-scheme
Last synced: 2 months ago
JSON representation
Blakley's secret sharing scheme python implementation
- Host: GitHub
- URL: https://github.com/charles-hsiao/python-blakley-secret-sharing-scheme
- Owner: charles-hsiao
- Created: 2019-06-03T23:49:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-16T05:26:26.000Z (over 6 years ago)
- Last Synced: 2025-06-25T02:44:54.853Z (3 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-blakley-secret-sharing-scheme
## Installation
1. Use python virtualenv(Recommand)
```
mkvirtualenv python
```2. Install pacakges with pip3
```
pip3 install -r requirements.txt
```## Flow
### Encryption mode
```
1. Read a given input file (plaintext)
2. Encrypt it using AES-256 with a randomly generated 256-bit key
3. Store encrypted file (ciphertext)
4. Split the key into n parts with threshold set to k
5. Store keys to be given out
```### Decryption mode
```
1. Read in encrypted file (ciphertext)
2. Read in the given t keys
3. Attempt to combine the keys into the original 256-bit key
4. Decrypt ciphertext with combined key using AES-256
5. Store decrypted file (plaintext)
```## Usage
### Encryption
```
python3 main.py -encrypt -infile sample-txt.txt -outfile output-txt.txt -keysfile key-txt.txt -n 5 -k 3
```### Decryption
```
python3 main.py -decrypt -infile output-txt.txt -outfile sample-txt-restored.txt -keysfile key-txt.txt
```