Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dofile = function(path,...)
- local f = loadfile(path)
- setfenv(f,_G)
- return f(...)
- end
- local Tunnel = dofile("Tunnel/init.lua","Tunnel")
- local modem = peripheral.wrap("back")
- local event = {}
- local secretNumber = Tunnel.DH.connect(modem,404)
- local AESkey = Tunnel.SHA.sha256(tostring(secretNumber))
- repeat
- event = {os.pullEvent()}
- until event[3] == 404 and event[1] == "modem_message"
- local id = event[5]
- print("ID: ")
- print(id)
- term.redirect(term.native())
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Input the password:")
- local input = read()
- local SHAInput = Tunnel.SHA.sha256(input)
- local encrypted = Tunnel.AES.encryptBytes(AESkey,SHAInput)
- modem.transmit(405,id,encrypted)
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement