So im storing passwords and usernames in separate files, and i want to decrypt them and check them, but whenever i decrypt the words, it adds characters to the original words:
def checkLogin(usernameInput, passwordInput, key, Usr):
f = Fernet(key)
with open("username.csv", "rb") as file:
encryptedUsername = file.read()
decryptedUsername = f.decrypt(encryptedUsername)
with open("password.csv", "rb") as file:
encryptedPassword = file.read()
decryptedPassword = f.decrypt(encryptedPassword)
print(decryptedPassword)
print(decryptedUsername)
usernameInput = usernameInput.get()
passwordInput = passwordInput.get()
the original Username and passwords were: "Admin" and "SecurePassword"
when i print the decrypted strings it returns: "b'SecurePassword
'"and "b'Admin'"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…