forked from Felici4no/PyCriptoNita
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (29 loc) · 1015 Bytes
/
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
from PyCriptoNita import *
print('.main')
show_banner()
key = key_generator(all_characters)
while True:
user = input('[1] Encrypt\n[2] Decrypt\n[3] Last key\n[4] Generate key\n[5] About\n[6] Quit\n - ')
if user == '6':
break
elif user == '1':
message = input_msg()
encrypted_message = encrypt_msg(message, key)
print("Encrypted Message:", encrypted_message)
elif user == '2':
encrypted_msg = input('Enter your message: ')
provided_key = input('Enter your key: ')
if len(provided_key) == len(key):
decrypted_message = decrypt_msg(encrypted_msg, provided_key)
print("Decrypted Message:", decrypted_message)
else:
print('This is not a valid key\n\n\n\n')
elif user == '3':
print('Last key:')
print(key)
elif user == '4':
key = key_generator(all_characters)
print("New key generated.")
elif user == '5':
show_banner()
print('PyCriptoNita is dead.')