import os
from cryptography.fernet import Fernet
#get files
files = []
for file in os.listdir():
if file == "ransomware.py" or file == "thekey.key" or file == "decrypt.py":
continue
if os.path.isfile(file):
files.append(file)
print(files)
with open("thekey.key" , "wb") as key:
secretkey = key.read()
secretphrase = "bootcon"
user_phrase = input("Enter Phrase to decrypt your files\n")
if user_phrase == secretphrase:
for file in files:
with open(file, "rb") as thefile:
contents = thefile.read()
contents_decrypted = Fernet(secretkey).decrypt(contents)
with open(file, "wb") as thefile:
thefile.write(contents_decrypted)
print("thank you your files are decrypted")
else:
print("Wrong try again")
i keep moving it but wont work