The crypto was a simple substitution cipher over the printable characters. After running it 50 times, the flag was printed```
import socket class Netcat:
    """ Python 'netcat like' module """
    def __init__(self, ip, port):
        self.buff = ""        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)        self.socket.connect((ip, port))
    def read(self, length = 1024):
        """ Read 1024 bytes off the socket """
        return self.socket.recv(length)     def read_until(self, data):
        """ Read data into the buffer until we have data """
        while not data in self.buff:            self.buff += self.socket.recv(1024)         pos = self.buff.find(data)        rval = self.buff[:pos + len(data)]        self.buff = self.buff[pos + len(data):]         return rval     def write(self, data):
        self.socket.send(data)     def close(self):
        self.socket.close()
# below is a extract from a sample exploit that# interfaces with a tcp socketprint "YES"# start a new Netcat() instancenc = Netcat('neverending.tuctf.com', 12345)while True:    print nc.read()    nc.write(" \n")    x=nc.read().split("is ")    b=ord(x[1][0])    ble=b-32    yo=x[2].split(" d")[0]    s=""    for i in yo:        ye=ord(i)-ble        if ye<32:            ye=ye-32+127        s=s+chr(ye)    print s    nc.write(s+"\n")
```