def encrypt(msg, p): newmsg = [] for I in range(0, 17): p = random.randint(1, 256) data = ord(msg[I]) ^ p newmsg.append(data) return str(newmsg)