python sha256 crypt decrypt

# encrypting
from cryptography.fernet import Fernet
message = "my deep dark secret".encode()

f = Fernet(key)
encrypted = f.encrypt(message)
# decrypting
from cryptography.fernet import Fernet
encrypted = b"...encrypted bytes..."

f = Fernet(key)
decrypted = f.decrypt(encrypted)

Here is what the above code is Doing:
1. Generate a key.
2. Encrypt a message using the key.
3. Decrypt the encrypted message using the key.