Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if #args < 2 then
- print("USAGE: encryptor [file] [key]")
- end
- local key = tonumber(args[2])
- local bytes = {}
- local handle = fs.open(args[1], "rb")
- while true do
- local byte = handle.read()
- if byte then
- table.insert(bytes, bit.bxor(byte, key))
- else
- break
- end
- end
- handle.close()
- local enc_handle = fs.open("data", "wb")
- for i,v in ipairs(bytes) do
- enc_handle.write(v)
- end
- enc_handle.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement