INTRODUCING, SMT!
Secure, easy to use modem transit!
Download:
wget https://gist.githubusercontent.com/steamp0rt/080de776670a778d3e612e1a05d2de77/raw/smt.min.lua smt.luaGithub: https://github.com/steamp0rt/SMT
Docs: https://steamp0rt.github.io/SMT/
Server Example:
local smt = require("/smt") local t = smt("smt.main.transit") t.openChannel(100) parallel.waitForAll(t.listener, function() while true do local ev, cid, data = os.pullEvent("RLWE-Receive") print("Received data! "..tostring(data)) end end)
Client Example:
local smt = require("/sm") local t = smt("smt.main.transit") t.openChannel(100) parallel.waitForAll(t.listener, function() t.openTunnel("f463820793", 100) local _,cid = os.pullEvent("RLWE-Finish") sleep(0.15) t.sendData(cid, "hai") end)
FAQ:
Q: So wait, what's this "f463820793" in the client example?
A: That's the server's UUID. The server can get it by either reading the ".rlwe_uuid" file, or reading "t.uuid", assuming t is smt("smt.main.transit").
Q: How does this work?
A: Basically, math shenanigans is used to exchange a key in a way that can't be intercepted. And yes, there IS forward secrecy!
Q: Can't I just pretend to have a UUID and intercept the handshake?
A: Not really! The server's static public-private keypair is used during the key exchange. Provided the client already has the public key (it does if you have already handshaked with it once), an attempt to spoof the server will fail the handshake.
Edited by Quartz101, 23 July 2018 - 07:56 PM.