#!/usr/bin/python2 import os, socket, struct, sys from Crypto.Cipher import AES class EncryptedStream(object): key = 'this is not the flag nor the key'[:16] def __init__(self, host, port): self.sock = socket.socket() self.sock.connect((host, port)) def send(self, msg): while len(msg) % 16: msg += '\0' iv = os.urandom(16) aes = AES.new(self.key, AES.MODE_ECB, iv) enc = aes.encrypt(msg) self.sock.send(struct.pack('