I m trying to make a passowrd locker, that takes input and encrypt the data and also am trying to save the data into a dictionary and encrypt the values only.
from cryptography.fernet import Fernet
key = Fernet.generate_key()
f = Fernet(key)
loc = {} # an empty dict that stores the keys and values
title = input( enter your title: ) # getting user title as key
secret = input( enter your secret: ) # getting secret as value to be encrypted
loc[title] = secret.encode() #turning the value into a byte for encryption
print(f.encrypt(secret)) # but am having an error trying to get through
希望得到任何帮助。 感谢。