I have this sample code that generates the key (password) by the fernet function to encrypt the string but what I want to do is choosing the password myself. How can I do it, please?
from cryptography.fernet import Fernet
key = Fernet.generate_key()
print(key)
message = "Hello World".encode()
key_obj = Fernet(key)
encrypted_message = key_obj.encrypt(message)
print(encrypted_message)
decrypted_message = key_obj.decrypt(encrypted_message)
print(decrypted_message)