-
Notifications
You must be signed in to change notification settings - Fork 0
/
encryptor_decryptor.py
61 lines (54 loc) · 2.07 KB
/
encryptor_decryptor.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/python3
from utilities import banner
from utilities.tools import clear
from utilities.colors import color
def call_EncryptorDecryptor(choice):
if choice==1:
from algos import shift
shift.run()
elif choice==2:
from algos import incremental_shift
incremental_shift.run()
elif choice==3:
from algos import affine
affine.run()
elif choice==4:
from algos import vigenere
vigenere.run()
elif choice==5:
from algos import morse_code
morse_code.run()
elif choice==6:
from algos import autokey
autokey.run()
elif choice==7:
from algos import multitap
multitap.run()
elif choice==8:
from algos import rot47
rot47.run()
else:
print('{}[!] Please enter a number between {}1 and {}{}'.format(color.RED,color.ORANGE,len(cipher_types),color.END))
def run():
try:
clear()
banner.show()
cipher_types = ['Rotational (Caesar) Cipher','Incremental Rotation Cipher','Affine Cipher\t','Vigenere Cipher','Morse Code (with Audio)','Autokey Cipher','Multitap (SMS Keypad) Code','Rot47',]
for i in range(len(cipher_types)):
print('{}({}) {}{}'.format(color.YELLOW, i+1, cipher_types[i], color.END),end='\t\t')
if i%2:
print('')
print('\n\t\t\t\t{}(0) EXIT{}'.format(color.YELLOW, color.END),end='\t')
try:
type_choice = int(input('\n{}[*] {}Choose the type of Cipher to work with >>>{} '.format(color.BLUE,color.CYAN,color.END)))
if type_choice not in range(1,len(cipher_types)+1):
if not type_choice:
raise KeyboardInterrupt()
raise ValueError()
call_EncryptorDecryptor(type_choice)
except ValueError:
print('{}[!] Please enter a number between {}1 and {}{}'.format(color.RED,color.ORANGE,len(cipher_types),color.END))
except KeyboardInterrupt:
print('\n{}[!] Exiting...{}'.format(color.RED,color.END))
if __name__ == '__main__':
run()