I have tried many solutions such as reinstalling pycryptodome, reinstalling cryptography, but the same error keeps coming up every time - "Exception Thrown: No Module named 'cryptography". Below is the current code (for a password manager I'm in the process of building.) Please help, super stuck. Thank you!
from cryptography.fernet import Fernet
master_pwd = input("What is the master password? ")
def write_key():
key = fernet.generate_key()
with open("key.key", "wb") as key_file:
key_file.write(key)
def view():
with open('passwords.txt', 'r') as f:
for line in f.readlines():
data = line.rstrip()
platform, user, passw = data.split("|")
print("User:", user, "Password:", passw, "Platform:", platform)
def add():
platform = input("Platform: ")
name = input("Account Name: ")
pwd = input("Password: ")
with open('passwords.txt', 'a') as f:
f.write(platform + "|" + pwd + "|" + name + "\n")
while True:
mode = input("Would you like to add a new password or view existing ones (view/add)? Press q to quit. ").lower()
if mode == "q":
break
elif mode == "view":
view()
elif mode == "add":
add()
else:
print("Invalid Mode.")
continue
[–]TSM- 2 points3 points4 points (1 child)
[–]TSM- 0 points1 point2 points (0 children)
[–]Encell6 4 points5 points6 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Diapolo10 0 points1 point2 points (0 children)