# call the library import ctypes from cryptography.fernet import Fernet import os # encryption methon key = b'ETWpoEG3C4uEjohifAAYe37R93uwhKijC2gsEDhM-w4=' path = r'C:\Users\osama\OneDrive\Desktop\Course videos\3.Encryption algorithms\database.jpeg' with open(path, 'rb') as f: rdata = f.read() encr = Fernet(key).encrypt(rdata) with open(path, 'wb') as f1: f1.write(encr) f.close() os.rename(path, path.split('.jpeg')[0] + '.db') def change_desktop_background(): key = b'ETWpoEG3C4uEjohifAAYe37R93uwhKijC2gsEDhM-w4=' path = r'C:\Users\osama\OneDrive\Desktop\Course videos\3.Encryption algorithms\database.db' new_path = path.replace('.db', '.jpeg') os.rename(path, new_path) with open(new_path, 'rb') as f: rdata = f.read() encr = Fernet(key).decrypt(rdata) with open(new_path, 'wb') as f1: f1.write(encr) ctypes.windll.user32.SystemParametersInfoW(20, 0, new_path, 0) change_desktop_background()