Here is a sample code for Encryption/Decryption program:
This code uses the cryptography library to encrypt and decrypt data using the Fernet algorithm. The Fernet.generate_key()
function generates a key to be used by the Fernet cipher. The encrypt_data(data)
function encrypts the given data by encoding it to bytes and then encrypting it using the cipher. The decrypt_data(encrypted_data)
function decrypts the given data by decrypting it using the cipher and then decoding it to a string.
Good Luck!
No comments:
Post a Comment