-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (32 loc) · 1.09 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Created Date: Friday, March 13th 2020, 12:48:29 am
Author: BaDMaN
Copyright (c) 2024 BaDMaN Soft
"""
import sys
import argparse
from cli_menu import main_menu
from core.encryption_core import EncryptionCore
if __name__ == "__main__":
if len(sys.argv) == 1:
args = main_menu()
else:
parser = argparse.ArgumentParser(description='BaDMaN soft')
parser.add_argument('-i', '--infile', help='Main file to crypt')
parser.add_argument('-o', '--outfile', help='Output file')
parser.add_argument('-f', '--files', nargs='+', help='files to encrypr or folder')
parser.add_argument('-d', '--decrypt', action='store_true', help='Decrypt flag')
parser.add_argument('-p', '--passphrase', help='Your password')
args = parser.parse_args()
core = EncryptionCore(
infile=args.infile,
outfile=args.outfile,
files=args.files,
passphrase=args.passphrase
)
if args.decrypt and args.infile:
core.decrypt()
elif args.infile:
core.encrypt()
else:
raise Exception('Arguments is empty')