I am trying to use Fernet to encrypt some text using user input as a key. However, I get an error. I've looked online but I can't find anything that helps. My code (all for testing purposes):
message = 'test message'
message = message.encode('utf-8')
key = input("")
key = key.encode('utf-8')
encrypt = base64.urlsafe_b64encode(key)
fernet = Fernet(encrypt)
encryptedmessage = fernet.encrypt(message)
print(message)
Any ideas on how to fix? I'm not looking for help with generating and using a secure key, I just want to use a user input as the key. Thank you in advance