Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function fetch(URL)
- local h = http.get(URL)
- local text = h.readAll()
- h.close()
- return text
- end
- local function fwrite(file, data)
- local f = fs.open(file, "w")
- f.write(data)
- f.close()
- end
- local ECC = loadstring(fetch "https://pastebin.com/raw/Sc0DU3rA")() "ecc"
- local function hexize(key)
- local out = ""
- for _, v in pairs(key) do
- out = out .. string.format("%.2x", v)
- end
- return out
- end
- write "Clearance level: "
- local level = tonumber(read())
- local pub, priv = ECC.keypair()
- fwrite("disk/keyfile", hexize(priv))
- print "Keyfile written to disk"
- print "Please add the linked text to your door configuration."
- fwrite(".temp", string.format([[["%s"] = %d]], hexize(pub), level))
- shell.run "pastebin put .temp"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement