--Wraps all I/O using rot13 encoding. return { rot13_c = function (c) local a = string.byte "a" local z = string.byte "z" local A = string.byte "A" local Z = string.byte "Z" local byte = string.byte(c) if byte >= a and byte <= z then return string.char(((byte - a) + 13) % 26 + a) elseif byte >= A and byte <= Z then return string.char(((byte - A) + 13) % 26 + A) else return c end end, rot13 = function (self, s) return (string.gsub(s, ".", function (c) return self.rot13_c(c) end)) end, recv = function (self, ...) local ret = table.pack(self.super:recv(...)) local line, err = table.unpack(ret) if line == nil then return table.unpack(ret) end return self:rot13(line), table.unpack(ret, 2, ret.n) end, send = function (self, data, ...) return self.super:send(self:rot13(data), ...) end, }