Answers for "python code to encrypt and decrypt a string with any password"

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 "python code to encrypt and decrypt a string with any password"

Python Answers by Framework

Browse Popular Code Answers by Language