--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 line, err = self.super:recv() if line == nil then return line, err end return self:rot13(line) end, send = function (self, data) return self.super:send(self:rot13(data)) end, }