Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open('right')
- local deCrypt = {} --do not change
- --change keys here
- local deCrypt1 = 'a'
- local deCrypt2 = 'b'
- --
- for num = 1,#deCrypt1 do
- local v = string.sub(deCrypt1,num,num)
- table.insert(deCrypt,string.byte(v))
- end
- while true do
- repeat
- id,msg,prot = rednet.receive()
- until type(msg) == 'table'
- for i,v in ipairs(msg) do
- if i ~= 1 then
- local num = v
- num = num/os.epoch()
- for i2,v2 in ipairs(deCrypt) do
- if i2%2 == 0 then
- num = num*v2
- else
- num = num/v2
- end
- end
- msg[i] = num
- end
- end
- local result = ''
- for i,v in ipairs(msg) do
- if type(v) == 'number' then
- if v <= 255 and v >= 0 then
- result = result..string.char(v)
- end
- end
- end
- print(result)
- if result == deCrypt2 then
- print('accepted')
- end
- end
Add Comment
Please, Sign In to add comment