-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfernetManagment.py
More file actions
25 lines (22 loc) · 930 Bytes
/
fernetManagment.py
File metadata and controls
25 lines (22 loc) · 930 Bytes
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
def encrypt(f, f2=0):
if f2 != 0:
encryptionInput = input('>> ').encode('utf-8')
encryptionOutput = f.encrypt(encryptionInput)
encryptionInput = encryptionOutput
encryptionOutput = f2.encrypt(encryptionInput)
print(encryptionOutput.decode('utf-8'))
else:
encryptionInput = input('>> ').encode('utf-8')
encryptionOutput = f.encrypt(encryptionInput)
print(encryptionOutput.decode('utf-8'))
def decrypt(f, f2=0):
if f2 != 0:
decryptionInput = input('>> ').encode('utf-8')
decryptionOutput = f2.decrypt(decryptionInput)
decryptionInput = decryptionOutput
decryptionOutput = f.decrypt(decryptionInput)
print(decryptionOutput.decode('utf-8'))
else:
decryptionInput = input('>> ').encode('utf-8')
decryptionOutput = f.decrypt(decryptionInput)
print(decryptionOutput.decode('utf-8'))