Hallo,
Ich habe ein Python-Skript gemacht, das alle untergeordneten Dateien verschlüsselt und will jetzt wissen, wie leicht es ist diese wieder zu entschlüsseln?
Hier ist mein Python-Skript;
#!/bin/python3
import os,pathlib,sys
from random_word import RandomWords
r=RandomWords()
randm_wrd=r.get_random_word()
path=(pathlib.Path().resolve())
filelist = []
for root, dirs, files in os.walk(path):
for file in files:
filelist.append(os.path.join(root,file))
def encrypt(filename):
to_encrypt=open(filename,"rb").read()
size=len(to_encrypt)
key=os.urandom(size)
encrypted=bytes(a^b for (a,b) in zip(to_encrypt,key))
with open(filename,"wb") as encrypted_out:
encrypted_out.write(encrypted)
verify=input(f"\n\nThis Programm may encrypt your files!\nIf you don't care just type: '{randm_wrd}' else just press enter: ")
if verify==randm_wrd:
files_done=0
for file in filelist:
encrypt(file)
files_done+=1
print(f"\n{files_done} got already encrypted!!!")
else:
print("\n\n\nWhy don't you want all you files to get encrypted!?!?!? What a shame!!!\n\n")
sys.exit()
print("\nThanks for using this programm!! It took me like 2 hours to create but I also learned things like new modules which I used for this programm.\n\n")
LG Irgendeinwer