def decrypt(cipherText, seed): MT = rnd.init8(seed) plainText = "" i = 1 for c in cipherText: rand = rnd.extract_numbers8(MT, i)[1] plainText += chr(rand ^ (ord(c))) i += 1 return plainText
def encrypt(Message, seed): MT = rnd.init8(seed) cipherText = "" i = 1 for c in Message: rand = rnd.extract_numbers8(MT, i)[1] cipherText += chr(rand ^ (ord(c))) i += 1 return cipherText