-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaiferCLIv2.py
More file actions
50 lines (40 loc) · 1.46 KB
/
SaiferCLIv2.py
File metadata and controls
50 lines (40 loc) · 1.46 KB
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
41
42
43
44
45
46
47
48
49
50
import random
import string
import sys
import os
import saifer
import argparse
# UNFINISHED
sai = saifer
def help(option):
if option is None:
print("-h, --help\t Show this help dialog or use with anther argument for further explanations. Ex: -hm, -hk")
print("-m, --mode\t The mode in which you want the program to run in.")
print("-k, --key\t The path of the key used in encryption or decryption.")
print("-t, --text\t The path of the text file to be encrypted.")
print("-s, --saifertext\t The path of the saifertext file to be decrypted.")
print("")
def main():
desc = "**************************"
desc += " SAIFER Encryption "
desc += "**************************"
parser = argparse.ArgumentParser(description=desc, add_help=False)
parser.add_argument("-h", "--help", action=argparse.BooleanOptionalAction)
#parser.add_argument("-h", "--help", type=str)
parser.add_argument("-m", "--mode", type=int)
parser.add_argument("-k", "--key", type=str)
parser.add_argument("-t", "--text", type=str)
parser.add_argument("-s", "--saifertext")
args = parser.parse_args()
if args.help:
help(None)
# TODO Connect these to the saifer.py backend
if(args.mode == 0):
print("Make Key")
elif(args.mode == 1):
print("Encrypt")
elif(args.mode == 2):
print("Decrypt")
else:
print("error")
main()