-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathencr.py
54 lines (35 loc) · 1.45 KB
/
encr.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
from cryptography.fernet import Fernet
# This file is used to access all the encrypted passwords and usernames
# Read https://cryptography.io/en/latest/fernet.html on how to create a key and encrypt your text
with open(r'D:\PyCharm Projects\timetablesel\test\file3.bin', 'rb') as file_object:
for line in file_object:
key = line
cipher_suite = Fernet(key)
with open(r'D:\PyCharm Projects\timetablesel\test\file2.bin', 'rb') as file_object:
for line in file_object:
encryptedpwd = line
with open(r'D:\PyCharm Projects\timetablesel\test\file1.bin', 'rb') as file_object:
for line in file_object:
encryptedusr = line
with open(r'D:\PyCharm Projects\timetablesel\test\file4e.bin', 'rb') as file_object:
for line in file_object:
encryptedusraca = line
with open(r'D:\PyCharm Projects\timetablesel\test\file4p.bin', 'rb') as file_object:
for line in file_object:
encryptedpwdaca = line
password_b = cipher_suite.decrypt(encryptedpwd)
username_b = cipher_suite.decrypt(encryptedusr)
usraca = cipher_suite.decrypt(encryptedusraca)
pwdaca = cipher_suite.decrypt(encryptedpwdaca)
usrne = bytes(username_b).decode("utf-8")
paswrd = bytes(password_b).decode("utf-8")
usrnaca = bytes(usraca).decode("utf-8")
paswrdaca = bytes(pwdaca).decode("utf-8")
def username_aca_plain():
return usrnaca
def password_aca_plain():
return paswrdaca
def username_plain():
return usrne
def password_plain():
return paswrd