Jump to content




SMT: Secure Modem Transit for ComputerCraft


1 reply to this topic

#1 Quartz101

  • Members
  • 141 posts
  • Location/dev/nvme0n1

Posted 23 July 2018 - 07:52 PM

it's like ringnet but better

INTRODUCING, SMT!

Secure, easy to use modem transit!

Download:
 wget https://gist.githubusercontent.com/steamp0rt/080de776670a778d3e612e1a05d2de77/raw/smt.min.lua smt.lua 
Github: 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.


#2 hugeblank

  • Members
  • 122 posts
  • LocationA grocery store near you!

Posted 27 July 2018 - 08:19 PM

First!

No, literally first to use this. Works really well considering the amount that I'm trying to send. This is one hell of a development for this community and I'm really excited to see where people go with this. Upvote for oyu because you deserve it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users