-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.py
More file actions
21 lines (18 loc) · 686 Bytes
/
Copy pathtools.py
File metadata and controls
21 lines (18 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import argparse
from utils.crypto import encrypt_file, decrypt_file
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('--file', help='File to decrypt', required=True)
parser.add_argument('--key', help='Encryption/Decryption key', required=True)
parser.add_argument(
'--encrypt', help='Encrypt current file',
action='store_true')
parser.add_argument(
'--decrypt', help='Decrypt current file', action='store_true')
args = parser.parse_args()
print(args)
if args.encrypt is True:
encrypt_file(args.key, args.file)
elif args.decrypt is True:
decrypt_file(args.key, args.file)
else:
print('Specify --encrypt or --decrypt')