Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("/.endpoint/enc/Caesar")
- local files = fs.list("/")
- function encrypt()
- for i,v in pairs(files) do
- if v == "rom" then
- -- Do nothing
- elseif v == "disk" then
- -- Do nothing
- elseif v == ".endpoint" then
- -- Do nothing
- elseif v == "startup" then
- -- Do nothing
- else
- if fs.isDir("/"..v) then
- for i,k in pairs(fs.list("/"..v)) do
- f = fs.open("/"..v.."/"..k,"r")
- a = f.readAll()
- f.close()
- f = fs.open("/"..v.."/"..k,"w")
- f.writeLine(Caesar.encrypt(a,17))
- f.close()
- end
- else
- f = fs.open("/"..v,"r")
- a = f.readAll()
- f.close()
- f = fs.open("/"..v,"w")
- f.writeLine(Caesar.encrypt(a,17))
- f.close()
- end
- end
- end
- end
- end
- function decrypt()
- for i,v in pairs(files) do
- if v == "rom" then
- -- Do nothing
- elseif v == "disk" then
- -- Do nothing
- elseif v == ".endpoint" then
- -- Do nothing
- elseif v == "startup" then
- -- Do nothing
- else
- if fs.isDir("/"..v) then
- for i,k in pairs(fs.list("/"..v)) do
- f = fs.open("/"..v.."/"..k,"r")
- a = f.readAll()
- f.close()
- f = fs.open("/"..v.."/"..k,"w")
- f.writeLine(Caesar.decrypt(a,17))
- f.close()
- end
- else
- f = fs.open("/"..v,"r")
- a = f.readAll()
- f.close()
- f = fs.open("/"..v,"w")
- f.writeLine(Caesar.decrypt(a,17))
- f.close()
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement