f = Fernet(key)

decrypted_data = f.decrypt(encrypted_data)

with open('encrypted_file.dat', 'rb') as file: encrypted_data = file.read()