Answers for "how to encrypt and decrypt text in python"

2

encrypt and decrypt python

# 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)
Posted by: Guest on May-24-2020

Code answers related to "how to encrypt and decrypt text in python"

Python Answers by Framework

Browse Popular Code Answers by Language